X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase.pm;h=abf15bfbcfd2b243b20c0a7adc7f27ae5050e5a3;hb=64ae166780d0cb2b9577e506da9b9b240c146d20;hp=3fe093001230914d2bb82efb814eec1e7d4fdec4;hpb=9780718f9c36738245f90b1f036998c3b076cffc;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 3fe0930..abf15bf 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -3,6 +3,7 @@ package DBIx::Class::Storage::DBI::Sybase; use strict; use warnings; use Try::Tiny; +use namespace::clean; use base qw/DBIx::Class::Storage::DBI/; @@ -54,21 +55,17 @@ sub _ping { if ($dbh->{syb_no_child_con}) { # if extra connections are not allowed, then ->ping is reliable - my $alive; - try { $alive = $dbh->ping } catch { $alive = 0 }; - return $alive; + return try { $dbh->ping } catch { 0; }; } - my $rc = 1; - try { + return try { # XXX if the main connection goes stale, does opening another for this statement # really determine anything? $dbh->do('select 1'); + 1; } catch { - $rc = 0; + 0; }; - - return $rc; } sub _set_max_connect {