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.

Reply via email to