merge on_connect_call updates
Rafael Kitover [Tue, 30 Jun 2009 01:39:51 +0000 (01:39 +0000)]
lib/DBIx/Class/Storage/DBI/Sybase.pm
t/746sybase.t

index d298e05..fa31f68 100644 (file)
@@ -62,20 +62,10 @@ sub _rebless {
         bless $self, 'DBIx::Class::Storage:DBI::Sybase::NoBindVars';
         $self->_rebless;
       }
-      $self->connect_call_datetime_setup;
-      $self->connect_call_blob_setup;
     }
   }
 }
 
-sub _populate_dbh {
-  my $self = shift;
-  $self->next::method(@_);
-  $self->connect_call_datetime_setup;
-  $self->connect_call_blob_setup;
-  1;
-}
-
 =head2 connect_call_blob_setup
 
 Used as:
index 2d0d491..2d18ef0 100644 (file)
@@ -26,7 +26,13 @@ for my $storage_type (@storage_types) {
   unless ($storage_type eq 'DBI::Sybase') { # autodetect
     $schema->storage_type("::$storage_type");
   }
-  $schema->connection($dsn, $user, $pass, {AutoCommit => 1});
+  $schema->connection($dsn, $user, $pass, {
+    AutoCommit => 1,
+    on_connect_call => [
+      [ 'datetime_setup' ],
+      [ blob_setup => log_on_update => 1 ], # this is a safer option
+    ],
+  });
 
   $schema->storage->ensure_connected;