[Bast-commits] r7928 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Sun Nov 22 10:03:33 GMT 2009


Author: caelum
Date: 2009-11-22 10:03:33 +0000 (Sun, 22 Nov 2009)
New Revision: 7928

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Sybase.pm
Log:
fix connection setup for Sybase

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-11-20 02:53:44 UTC (rev 7927)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-11-22 10:03:33 UTC (rev 7928)
@@ -120,8 +120,8 @@
   my $self = shift;
   $self->_set_max_connect(256);
 
-  # based on LongReadLen in connect_info
-  $self->set_textsize if $self->using_freetds;
+# this is also done on _populate_dbh, but storage may not be reblessed yet
+  $self->_syb_setup_connection;
 
 # create storage for insert/(update blob) transactions,
 # unless this is that storage
@@ -182,15 +182,24 @@
   $self->next::method;
 }
 
+sub _populate_dbh {
+  my $self = shift;
+
+  $self->next::method(@_);
+
+  $self->_syb_setup_connection;
+}
+
+# Set up session settings for Sybase databases for the connection, called from
+# _populate_dbh and _init (before _driver_determined .)
+#
 # Make sure we have CHAINED mode turned on if AutoCommit is off in non-FreeTDS
 # DBD::Sybase (since we don't know how DBD::Sybase was compiled.) If however
 # we're using FreeTDS, CHAINED mode turns on an implicit transaction which we
 # only want when AutoCommit is off.
-sub _populate_dbh {
+sub _syb_setup_connection {
   my $self = shift;
 
-  $self->next::method(@_);
-
   return unless $self->_driver_determined; # otherwise we screw up MSSQL
 
   if ($self->_is_bulk_storage) {
@@ -202,6 +211,9 @@
   if (not $self->using_freetds) {
     $self->_dbh->{syb_chained_txn} = 1;
   } else {
+    # based on LongReadLen in connect_info
+    $self->set_textsize;
+
     if ($self->_dbh_autocommit) {
       $self->_dbh->do('SET CHAINED OFF');
     } else {




More information about the Bast-commits mailing list