Mailing List Archive

Re: Odd problem with DBI-0.63....
> From: descarte@mcqueen.com
>
> Seems to occur with both DBD::Oracle and DBD::mSQL.....
>
> $testcursor->finish;
> $dbh->disconnect;
>
> disconnect(DBI::db=HASH(0x1489c4)) invalidates 1 associated cursor(s) at p line 28.
>
> Any ideas? I notice it on *every* script I'm running against this DBI?
> Is there a new one out that I've missed?
>
Here's the code (note the XXX comment):

/* Check for disconnect() being called whilst refs to cursors */
/* still exists. This needs some more thought. */
/* XXX We need to track DBIc_ACTIVE children not just all children */
if (DBIc_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !dirty) {
warn("disconnect(%s) invalidates %d associated cursor(s)",
SvPV(dbh,na), (int)DBIc_KIDS(imp_dbh));
}

Adding an "undef $testcursor;" or "$testcursor=0"; or having $testcursor
go out of scope before the disconnect would all work.

The real fix, as the comment says, it track DBIc_ACTIVE children not just
all children. It's on my todo list.

Tim.