And lose yet another dependency: List::Util (yes, I know it's core)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Oracle / Generic.pm
index 2bea8b9..b196b80 100644 (file)
@@ -7,9 +7,7 @@ use mro 'c3';
 use DBIx::Class::Carp;
 use Scope::Guard ();
 use Context::Preserve 'preserve_context';
-use Try::Tiny;
-use List::Util 'first';
-use DBIx::Class::_Util 'modver_gt_or_eq_and_lt';
+use DBIx::Class::_Util qw( modver_gt_or_eq_and_lt dbic_internal_try );
 use namespace::clean;
 
 __PACKAGE__->sql_limit_dialect ('RowNum');
@@ -273,12 +271,13 @@ sub _ping {
   local $dbh->{RaiseError} = 1;
   local $dbh->{PrintError} = 0;
 
-  return try {
+  ( dbic_internal_try {
     $dbh->do('select 1 from dual');
     1;
-  } catch {
-    0;
-  };
+  })
+    ? 1
+    : 0
+  ;
 }
 
 sub _dbh_execute {
@@ -286,7 +285,7 @@ sub _dbh_execute {
   my ($self, $sql, $bind) = @_[0,2,3];
 
   # Turn off sth caching for multi-part LOBs. See _prep_for_execute below
-  local $self->{disable_sth_caching} = 1 if first {
+  local $self->{disable_sth_caching} = 1 if grep {
     ($_->[0]{_ora_lob_autosplit_part}||0)
       >
     (__cache_queries_with_max_lob_parts - 1)