X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=3e74d427e67a5151c5cab32ce1c4e262054eb43c;hp=c8325369470f62c5930c4db89f7413f3d5943866;hb=ed7ab0f4ce1a9118ea6285ee562ef003085a6b64;hpb=7803e57ad8daee28020676140ea6894c31e3112e diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index c832536..3e74d42 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -4,6 +4,7 @@ use strict; use warnings; use Scope::Guard (); use Context::Preserve (); +use Try::Tiny; =head1 NAME @@ -112,11 +113,14 @@ sub _ping { local $dbh->{RaiseError} = 1; local $dbh->{PrintError} = 0; - eval { + my $rc = 1; + try { $dbh->do('select 1 from dual'); + } catch { + $rc = 0; }; - return $@ ? 0 : 1; + return $rc; } sub _dbh_execute { @@ -129,14 +133,16 @@ sub _dbh_execute { RETRY: { do { - eval { + my $exception; + try { if ($wantarray) { @res = $self->next::method(@_); } else { $res[0] = $self->next::method(@_); } + } catch { + $exception = shift; }; - $exception = $@; if ($exception =~ /ORA-01003/) { # ORA-01003: no statement parsed (someone changed the table somehow, # invalidating your cursor.)