Re: finishing sth using Childhandles
- From: henri@xxxxxxxxxxxxx (Henri Asseily)
- Date: Tue, 29 Aug 2006 13:44:02 +0200
Thanks, Tim.
One more question to the group:
If I "undef $dbh" when it is active and it has active (or inactive) child handles, what happens exactly?
Is an actual $dbh->disconnect() made, and are the $sth's finished at all? Is it DBD dependent?
Thanks in advance,
Henri.
On Aug 28, 2006, at 11:15 PM, Tim Bunce wrote:
On Thu, Aug 24, 2006 at 09:47:56AM +0200, Henri Asseily wrote:Is the below the correct usage for finishing still active child
handles of a dbh?
foreach my $childh (@{$dbh->{ChildHandles}}) {
$childh->finish() if ($childh->{Type} eq 'st');
}
The children of a dbh will always be sth, but the test is harmless.
I'm getting an error when running the above code:
dbih_setup_fbav: invalid number of fields: -1, NUM_OF_FIELDS attribute probably not set right
Looks like a bug (in the driver, I'd guess, but you don't say which)
because calling finish should never need to call dbih_setup_fbav.
But checking for Active will probably avoid the problem:
$_->finish for grep { $_->{Active} } @{$dbh->{ChildHandles}};
Tim.
.
- References:
- finishing sth using Childhandles
- From: Henri Asseily
- Re: finishing sth using Childhandles
- From: Tim Bunce
- finishing sth using Childhandles
- Prev by Date: Re: ANNOUNCE: DBI 1.52 - plus PDF of "What's New" presentation
- Next by Date: RE: Oralce10g database compatible Perl version, DBD and DBI -on URGENT Basis
- Previous by thread: Re: finishing sth using Childhandles
- Next by thread: Re: finishing sth using Childhandles
- Index(es):
Relevant Pages
|