always reconnect in odbc:mssql:connect_call_use_dynamic_cursors
Rafael Kitover [Tue, 18 Aug 2009 04:19:12 +0000 (04:19 +0000)]
lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm

index 5279502..47293d4 100644 (file)
@@ -75,9 +75,8 @@ sub connect_call_use_dynamic_cursors {
   if (not exists $dbi_attrs->{odbc_cursortype}) {
     # turn on support for multiple concurrent statements, unless overridden
     $dbi_attrs->{odbc_cursortype} = 2;
-    my $connected = defined $self->_dbh;
-    $self->disconnect;
-    $self->ensure_connected if $connected;
+    $self->disconnect; # resetting dbi attrs, so have to reconnect
+    $self->ensure_connected;
     $self->_set_dynamic_cursors;
   }
 }