my $self = shift;
$self->_set_max_connect(256);
-# 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
return if $self->_is_extra_storage;
$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 .)
+# Set up session settings for Sybase databases for the connection.
#
# 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 _syb_setup_connection {
+#
+# Also SET TEXTSIZE for FreeTDS because LongReadLen doesn't work.
+sub _run_connection_actions {
my $self = shift;
- return unless $self->_driver_determined; # otherwise we screw up MSSQL
-
if ($self->_is_bulk_storage) {
# this should be cleared on every reconnect
$self->_began_bulk_work(0);
$self->_dbh->do('SET CHAINED ON');
}
}
+
+ $self->next::method(@_);
}
=head2 connect_call_blob_setup
local $dbh->{PrintError} = 0;
if ($dbh->{syb_no_child_con}) {
-# ping is impossible with an active statement, we return false if so
+# if extra connections are not allowed, then ->ping is reliable
my $ping = eval { $dbh->ping };
return $@ ? 0 : $ping;
}
}
}
-sub _init {
+sub _run_connection_actions {
my $self = shift;
# LongReadLen doesn't work with MSSQL through DBD::Sybase, and the default is
# huge on some versions of SQL server and can cause memory problems, so we
# fix it up here (see Sybase/Common.pm)
$self->set_textsize;
+
+ $self->next::method(@_);
}
sub _dbh_begin_work {