On Wed, 13 Feb 2002, H.Merijn Brand wrote: >On Wed 13 Feb 2002 02:02, Jonathan Leffler <[EMAIL PROTECTED]> wrote: >> +=over 4 >> + >> +*FIX ME* If there are statements 'active' when the $dbh is destroyed, >> +does DBI arrange to destroy those statement handles, or does the driver need to >> +do the work itself? >> + >> +=back > >Depends on the database. In DBD-Unify I *have to* do it myself, but some >guidelines would be much appreciated for future DBD's
At the moment, the DBD::Informix driver explicitly keeps track of all the database handles it has, and for each database handle, keeps a track of all the associated statement handles. When a database handle is destroyed, I have code that tracks through all the associated statement handles and releases them. *BUT* I've never spotted any activity while doing this. So, I think that DBI is also keeping track of statement handles and calling the statement handle release code before calling the database handle release code, so my driver is doing unnecessary work. I'd like to get rid of the code that tracks statement handles (in particular) and database handles. But I'd like a clear statement from those who can understand the DBI code that this is unnecessary. I also readily admit that I (DBD::Informix) could be misusing the IMPSET and ACTIVE flags - the last time I really experimented with them at all was back in the days of DBI 0.6x or thereabouts, and lots of things have changed since then. I note that with Informix, there are resources associated with a prepared statement that should be released when the statement is destroyed. The active flag is only to be used for SELECT statements. I have to assume that the IMPSET flag should be set for prepared statements so that they are destroyed correctly. All this needs to be written out clearly (and with luck will be by the time I've finished), but it needs accurate input - GIGO applies. -- Jonathan Leffler #include <disclaimer.h> STSM, Informix Database Engineering, IBM Data Management Solutions Phone: +1 650-926-6921 Tie-line: 630-6921 Email: [EMAIL PROTECTED] ([EMAIL PROTECTED]) Notes ID: Jonathan Leffler/Menlo Park/IBM@IBMUS Guardian of DBD::Informix v1.00.PC1 -- http://dbi.perl.org *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Please update your address book to use [EMAIL PROTECTED] because [EMAIL PROTECTED] will not work starting 2002-07-01. Expect slower responses because I can't use Lotus Notes as fast as Unix email. One day, this signature will shrink! PS: GIGO = Garbage In, Garbage Out.
