On Thu, Feb 07, 2002 at 07:12:12PM +0300, Andrew Ivanov wrote:
>
> Dear Tim,
>
> I receive the error "Can't read $DBI::err, last handle unknown or destroyed
> during global destruction" many times (and for $DBI::errstr too).
> I'm not able to say what is the reason of these errors. Setting the trace levelel
> to 10 didn't help, and trace files were the same for erroneous and correct runs.
Have any DBI handles been used before $DBI::err is used?
Does it happen in when the program exits?
Does it happen in an error handler?
Which DBD?
Please try to cut down the code to the smallest part that reproduces the problem.
> I would like to ask you to apply this patch to DBI.xs, because you've mentioned
> this: /* warn() may be changed to a debug later */
>
> I would like to ask you to apply patch provided, which do exactly that thing.
But I'd rather not sweep something under the carpet without knowing what it is!
> In occasion, I would like to thank you for this great module. Thanks!
Thanks!
Tim.
p.s. Instead of $DBI::err you can use $h->err.
> Best regards,
> Andrew Ivanov.
> --- DBI.xs.orig Thu Feb 7 18:27:39 2002
> +++ DBI.xs Thu Feb 7 18:29:10 2002
> @@ -2960,8 +2960,10 @@
> SvROK_off(DBI_LAST_HANDLE);
> XSRETURN(1);
> }
> - if ( !ok ) { /* warn() may be changed to a debug later */
> - warn("Can't read $DBI::%s, last handle unknown or destroyed", meth);
> + if ( !ok ) {
> + if (trace) {
> + PerlIO_printf(DBILOGFP, "Can't read $DBI::%s, last handle unknown or
>destroyed\n", meth);
> + }
> XSRETURN_UNDEF;
> }
>