PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: Feature request: set maximum number of connections
Date: Jan 30 2004 6:45PM

On Fri, 2004-01-30 at 06:48, Avis, Ed wrote:
> I was surprised to find that MAX_CONNECT can be set in ctlib even if
> there are connections already open.  So there's no reason it can't be
> specified in the connection string with each new connection.  The
> attached patch adds a maxConnect parameter, eg
> 
>     DBI->connect(
>      'dbi:Sybase:server=MY_SERVER;maxConnect=99;database=my_database',
>      'user', 'pass');
> 
> You can set maxConnect as you want, but ctlib will understandably get
> upset if you try to reduce it to less than the number of currently
> open connections.  Since the only time maxConnect is used is when
> calling connect(), there does not need to be any other interface to
> set it.
> 
> Michael P. - are you happy with the principle of passing in maxConnect
> like this?  If so I will start writing code that uses it.  Also let me
> know whether you are happy with the implementation in this patch.

I think it is mostly OK. I'm not sure about returning 0 and failing the
connect if the validation fails, but that's something that I just have
to think about a little bit. Certainly the implementation at the perl
level looks fine.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                 http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.mbay.net/~mpeppler/resume.html