Re: Feature request: turn off the multiple statement handle emulation

Michael Peppler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
On Wed, 2006-03-22 at 15:33 +0000, Avis, Ed wrote:
> If AutoCommit is off and you try to open two statement handles at the
> same time then DBD::Sybase silently opens a new database connection.
> This is documented, but I think it's a trap for the unwary, since just
> forgetting to put 'finish $sth' earlier in your program will trigger it
> and there is no warning.
> 
> I think there should be a safe mode where DBD::Sybase will never open a
> new database connection unless you explicitly ask for it.  I would even
> suggest that this mode should be the default, but it may be too late to
> change that.

The attribute is called syb_no_child_con:

       syb_no_child_con (bool)
           If this attribute is set then DBD::Sybase will not allow multiple
           simultaneously active statement handles on one database handle
           (i.e.  multiple $dbh->prepare() calls without completely processing
           the results from any existing statement handle). This can be used
           to debug situations where incorrect or unexpected results are found
           due to the creation of a sub-connection where the connection
           attributes (in particular the current database) are different.

           Default: off

I agree (now, possibly almost 8 years too late :-) that this should
probably be the default behavior.

Maybe it could be a build-time option (like the Chained mode for
AutoCommit=0).

Michael
-- 
Michael Peppler  -  [email protected]  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.