From: Peter Rabbitson Date: Sat, 7 Apr 2012 10:11:23 +0000 (+0200) Subject: Better detection/synchronization of MSSQL dynamic cursor state X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23eae1757461efb9dfc3ad207f47f6c334c38887;p=dbsrgits%2FDBIx-Class-Historic.git Better detection/synchronization of MSSQL dynamic cursor state --- diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm index 7a149f2..e0fe1ea 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -211,6 +211,8 @@ sub connect_call_use_dynamic_cursors { sub _run_connection_actions { my $self = shift; + $self->next::method (@_); + # keep the dynamic_cursors_support and driver-state in sync # on every reconnect my $use_dyncursors = ($self->_dbic_connect_attributes->{odbc_cursortype} || 0) > 1; @@ -238,16 +240,17 @@ sub _run_connection_actions { $self->_using_dynamic_cursors(1); $self->_identity_method('@@identity'); - $self->_no_scope_identity_query($self->_using_freetds); } else { $self->_using_dynamic_cursors(0); $self->_identity_method(undef); - $self->_no_scope_identity_query(undef); } } - $self->next::method (@_); + $self->_no_scope_identity_query($self->_using_dynamic_cursors + ? $self->_using_freetds + : undef + ); # freetds is too damn broken, some fixups if ($self->_using_freetds) {