Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 20701
Status: rejected
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: vmt005 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug with non-executed queries
Date: Wed, 26 Jul 2006 11:06:12 -0700 (PDT)
To: bug-DBD-SQLite [...] rt.cpan.org
From: Vini Mat <vmt005 [...] yahoo.com>
Hi, This is the first time I report a bug to CPAN, sorry if I'm doing it the wrong way. This is my test script: ---------------- use DBI; $dbh = DBI->connect("dbi:SQLite:dbname=blah.db","","",{ AutoCommit => 0 }); $sql = $dbh->prepare("select * from t"); $sql->finish; $dbh->disconnect; ---------------- (It assumes there is a table called 't' in database 'blah.db') After running it, I always get a "closing dbh with active statement handles" message. To make sure, I ran the same script on an oracle database (using DBD-Oracle), and didn't get the message (as I expected). To get around it, I just issued a "$sql->execute" command just before disconnecting. I believe there is something preventing the $dbh->disconnect from resetting the Active flag for child statements that have been prepared but not executed, or something like that. Thanks, Vini --------------------------------- Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups.
There's no real fixed definition of how a DBD driver should handle this situation as it ends up being down to how the driver is implemented and when calls to the API need to occur. This would be practically impossible to fix without keeping track of all statement handles within the driver, and that's very hard to do. In short, use better scoping and you won't be bitten by this issue. Rejecting the bug as WONTFIX.