From: Rafael Kitover Date: Tue, 14 Jul 2009 23:39:02 +0000 (+0000) Subject: set maxConnect in DSN and add docs X-Git-Tag: v0.08112~14^2~105 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41c93b1b263e8dab5365cc892c7b770fd83ba0a1;p=dbsrgits%2FDBIx-Class.git set maxConnect in DSN and add docs --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index fed74c8..5e1e5eb 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -65,10 +65,27 @@ sub _rebless { bless $self, 'DBIx::Class::Storage::DBI::Sybase::NoBindVars'; $self->_rebless; } + $self->_set_maxConnect; } } } +sub _set_maxConnect { + my $self = shift; + + my $dsn = $self->_dbi_connect_info->[0]; + + return if ref($dsn) eq 'CODE'; + + if ($dsn !~ /maxConnect=/) { + $self->_dbi_connect_info->[0] = "$dsn;maxConnect=256"; + # will take effect next connection + my $connected = defined $self->_dbh; + $self->disconnect; + $self->ensure_connected if $connected; + } +} + =head2 connect_call_blob_setup Used as: @@ -254,6 +271,20 @@ sub _dbh_last_insert_id { 1; +=head1 MAXIMUM CONNECTIONS + +L makes separate connections to the server for active statements in +the background. By default the number of such connections is limited to 25, on +both the client side and the server side. + +This is a bit too low, so on connection the clientside setting is set to C<256> +(see L.) You can override it to whatever setting you +like in the DSN. + +See +L +for information on changing the setting on the server side. + =head1 DATES See L to setup date formats