This is a problem that happens in Win32 if you reach global destruction with
a database handle still defined even though it is not open.  Assign undef to
$dbh after you call $dbh->disconnect to cause it to be deallocated before
global destruction.

$sth->finish is unnecessary and is strongly not recommended in this case,
but it shouldn't do any active harm.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: "Sterin, Ilya" <[EMAIL PROTECTED]>
To: "'RICHARD A. NAKROSHIS (Contractor) '" <[EMAIL PROTECTED]>;
"'DBI User's Mailing List '" <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 13:29
Subject: RE: Error on ->disconnect?


> That has nothing to do with you disconnect.  You are not using finish()
> properly, which in your case should not be used at all.  You are actually
> disallocating the handle which you prepared and on the second while() run,
> there is nothing to execute.
>
> See documentation on finish().
>
> -----Original Message-----
> From: RICHARD A. NAKROSHIS (Contractor)
> To: DBI User's Mailing List
> Sent: 7/12/01 2:23 PM
> Subject: Error on ->disconnect?
>
> I'm new to DBI programming, and get an error on exiting my program,
> which does query the database and return values.  The problem seems to
> be with the line $rc = $dbh->disconnect, which does not appear to be
> executed.  Can anyone point out what I'm doing wrong?
>
> Rick
>
> (begin error messages)
>
> (in cleanup) Uncaught exception from user code:
> Can't call method "FETCH" on an undefined value at
> C:/Perl/site/lib/Win32/TieRegistry.pm line 1486, <> line 4 during global
> destruction.
> Win32::TieRegistry::DESTROY('Win32::TieRegistry=HASH(0x22292a0)') called
> at ora-test.pl line 0
> eval {...} called at ora-test.pl line 0


Reply via email to