X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase%2FBase.pm;h=be57610f0ae8c072ea01a6cc86fafc543147dc38;hb=8c4b6c50e873a2b5993d1bfe0f40763d994b7da4;hp=d4e287ee0d7bcd94e2476d380166fb03ad6c8b5d;hpb=526dc858fec4cfc63c8bc2de69c972fc6cbcccec;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm index d4e287e..be57610 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm @@ -1,40 +1,27 @@ -package DBIx::Class::Storage::DBI::Sybase::Base; +package # hide from PAUSE + DBIx::Class::Storage::DBI::Sybase::Base; use strict; use warnings; +use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; + =head1 NAME DBIx::Class::Storage::DBI::Sybase::Base - Common functionality for drivers using -L - -=head1 METHODS - -=head2 connected - -Returns true if we have an open (and working) database connection, false if it -is not (yet) open (or does not work). (Executes a simple SELECT to make sure it -works.) - -The reason this is needed is that L's ping() does not work with an -active statement handle, leading to masked database errors. +DBD::Sybase =cut -sub connected { +sub _ping { my $self = shift; - my $super = eval { $self->next::method(@_) }; - - return $super unless $@; + my $dbh = $self->_dbh or return 0; - my $dbh = $self->_dbh; local $dbh->{RaiseError} = 1; - eval { - my $ping_sth = $dbh->prepare_cached("select 1"); - $ping_sth->execute; - $ping_sth->finish; + $dbh->do('select 1'); }; return $@ ? 0 : 1;