[Bast-commits] r6914 - in DBIx-Class/0.08/branches/syb_connected:
lib/DBIx/Class/Storage/DBI/Sybase t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed Jul 1 13:35:09 GMT 2009
Author: caelum
Date: 2009-07-01 13:35:07 +0000 (Wed, 01 Jul 2009)
New Revision: 6914
Modified:
DBIx-Class/0.08/branches/syb_connected/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
DBIx-Class/0.08/branches/syb_connected/t/746sybase.t
DBIx-Class/0.08/branches/syb_connected/t/74mssql.t
Log:
better connection test
Modified: DBIx-Class/0.08/branches/syb_connected/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
===================================================================
--- DBIx-Class/0.08/branches/syb_connected/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-07-01 13:25:46 UTC (rev 6913)
+++ DBIx-Class/0.08/branches/syb_connected/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-07-01 13:35:07 UTC (rev 6914)
@@ -24,12 +24,13 @@
sub connected {
my $self = shift;
+ my $super = eval { $self->next::method(@_) };
+
+ return $super unless $@;
+
my $dbh = $self->_dbh;
-
local $dbh->{RaiseError} = 1;
- my $ping_sth;
-
eval {
my $ping_sth = $dbh->prepare_cached("select 1");
$ping_sth->execute;
Modified: DBIx-Class/0.08/branches/syb_connected/t/746sybase.t
===================================================================
--- DBIx-Class/0.08/branches/syb_connected/t/746sybase.t 2009-07-01 13:25:46 UTC (rev 6913)
+++ DBIx-Class/0.08/branches/syb_connected/t/746sybase.t 2009-07-01 13:35:07 UTC (rev 6914)
@@ -16,7 +16,7 @@
# start disconnected to test reconnection
$schema->storage->ensure_connected;
-$schema->storage->disconnect;
+$schema->storage->_dbh->disconnect;
isa_ok( $schema->storage, 'DBIx::Class::Storage::DBI::Sybase' );
Modified: DBIx-Class/0.08/branches/syb_connected/t/74mssql.t
===================================================================
--- DBIx-Class/0.08/branches/syb_connected/t/74mssql.t 2009-07-01 13:25:46 UTC (rev 6913)
+++ DBIx-Class/0.08/branches/syb_connected/t/74mssql.t 2009-07-01 13:35:07 UTC (rev 6914)
@@ -24,7 +24,7 @@
# start disconnected to test reconnection
$schema->storage->ensure_connected;
-$schema->storage->disconnect;
+$schema->storage->_dbh->disconnect;
my $dbh = $schema->storage->dbh;
More information about the Bast-commits
mailing list