Re: Re: pqReadData() - backend unexpectedly closed the channel

From: Dirk Lutzebaeck <lutzeb(at)aeccom(dot)com>
To: "Rob Arnold" <rob(at)cabrion(dot)com>
Cc: "Scott Price" <Scott(dot)Price(at)sci(dot)com>, <pgsql-general(at)postgresql(dot)org>, "<Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Re: pqReadData() - backend unexpectedly closed the channel
Date: 2001-03-13 11:38:29
Message-ID: 15022.1717.687734.702521@ampato.core.aeccom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rob Arnold writes:
> I can make this happen consistently with Perl DBI by placing a
> $dbh->disconnect() in the DESTROY subroutine of an object. I doubt the two
> issues have much in common, but there's my $.02. You might post to the list
> (not me, I'm ignorant) how you managed to make this happen.

Yes, the same here. You must not does this as the described in DBI
manpage (last sentence):

The database is automatically disconnected (by the
DESTROY method) if still connected when there are no
longer any references to the handle. The DESTROY
method for each driver should implicitly call rollback
to undo any uncommitted changes. This is vital
behaviour to ensure that incomplete transactions don't
get committed simply because Perl calls DESTROY on
every object before exiting. Also, do not rely on the
order of object destruction during 'global
destruction', it is undefined.

Dirk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message gravity 2001-03-13 11:53:08 Re: postgresql to mysql conversion?
Previous Message The Hermit Hacker 2001-03-13 11:27:21 Re: postgresql to mysql conversion?