X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FMSSQL.pm;fp=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FMSSQL.pm;h=5b4c422b283e1e8eb25c89017ed52d85b8c9ae80;hb=b58ec618e9efcae245aed37529738180c551db91;hp=90c05f8d35c0e57edf9511ffa49dcd89a9d308e6;hpb=ceb5f4120b53e71772d8158215e0644961b1a92c;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 90c05f8..5b4c422 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -10,7 +10,6 @@ use base qw/ use mro 'c3'; use Try::Tiny; -use DBIx::Class::_Util qw( sigwarn_silencer ); use List::Util 'first'; use namespace::clean; @@ -176,31 +175,13 @@ sub _ping { my $dbh = $self->_dbh or return 0; - try { - local $dbh->{RaiseError} = 1; - local $dbh->{PrintError} = 0; + local $dbh->{RaiseError} = 1; + local $dbh->{PrintError} = 0; + + return try { $dbh->do('select 1'); 1; - } - catch { - # MSSQL is *really* annoying wrt multiple active resultsets, - # and this may very well be the reason why the _ping failed - # - # Proactively disconnect, while hiding annoying warnings if the case - # - # The callchain is: - # < check basic retryability prerequisites (e.g. no txn) > - # ->retry_handler - # ->storage->connected() - # ->ping - # So if we got here with the in_handler bit set - we won't break - # anything by a disconnect - if( $self->{_in_do_block_retry_handler} ) { - local $SIG{__WARN__} = sigwarn_silencer qr/disconnect invalidates .+? active statement/; - $self->disconnect; - } - - # RV of _ping itself + } catch { 0; }; }