On Tue, Feb 17, 2004 at 10:32:55AM -0600, Jay Hannah wrote:
> 
> From: Tim Bunce [mailto:[EMAIL PROTECTED]
> > On Mon, Feb 16, 2004 at 07:46:49PM -0600, Jay Hannah wrote:
> > ...it seems that it is being thrown in global destruction in the 2 DBD's 
> > I use the most...
> > > DBD::Informix -> Informix 9.3:            Issuing rollback() for database...
> > > DBD::Informix -> Informix SE (ancient):   No warning
> > > DBD::Sybase -> freetds -> MS-SQL server:  Issuing rollback() for database...
> > > DBD::Proxy -> DBD::Oracle -> Oracle (v?): No warning
> > > DBD::Oracle -> Oracle (v?):               No warning
> > > DBD::mysql:                               No warning
> > 
> > I suspect in some of the cases you quote above AutoCommit is not off,
> > or the DESTROY is happening during global destruction.
> 
> The tests above were all global destruction. perldoc DBI:
> 
>    Also, do not rely on the order of object destruction 
>    during "global destruction", as it is undefined.

The "!dirty" in the code I posted means that the wrning will never
be generated during global destruction.

Just prior to global destruction there's a cleanup of the outer scope
(as I recall) and maybe that's when your handles are being destroyed.

> In any event, harkening back to my Programmer X example last night I believe what 
> I'm inquiring about is the ability to turn on a flag in DBI so any implicit DESTROYs 
> of $dbh's and $sth's would bark.
> 
> But if "global destruction order is undefined" means that no such feature could ever 
> be reliable then I withdraw my inquiry because the majority of the cases where I'd 
> want the feature would be during global destruction (our "sloppy code"). 
> 
> Do I understand that correctly?

Er, probably. Anyway, feel free to subclass and do whatever you'd like :)

Tim.

Reply via email to