From: Rafael Kitover Date: Sun, 24 May 2009 23:49:17 +0000 (+0000) Subject: fix double connect for ODBC/MSSQL X-Git-Tag: v0.08103~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b3e916d6dd153ac8071cb1a13b4e2f84de87b28;p=dbsrgits%2FDBIx-Class.git fix double connect for ODBC/MSSQL --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 83de252..32084bd 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -614,15 +614,15 @@ sub _populate_dbh { my @info = @{$self->_dbi_connect_info || []}; $self->_dbh($self->_connect(@info)); + $self->_conn_pid($$); + $self->_conn_tid(threads->tid) if $INC{'threads.pm'}; + $self->_determine_driver; # Always set the transaction depth on connect, since # there is no transaction in progress by definition $self->{transaction_depth} = $self->_dbh_autocommit ? 0 : 1; - $self->_conn_pid($$); - $self->_conn_tid(threads->tid) if $INC{'threads.pm'}; - my $connection_do = $self->on_connect_do; $self->_do_connection_actions($connection_do) if $connection_do; } diff --git a/t/746mssql.t b/t/746mssql.t index 3e70574..05317b6 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -15,6 +15,7 @@ plan tests => 12; my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {AutoCommit => 1}); $schema->storage->ensure_connected; + isa_ok( $schema->storage, 'DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server' ); $schema->storage->dbh_do (sub {