Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Feature request: turn off the multiple statement handle
Date: Mar 22 2006 4:52PM
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:
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.
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
Michael Peppler - firstname.lastname@example.org - http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html