Re: EOF error

johnf <jfabiani-rLSQ/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Wednesday 27 February 2008 03:02:08 pm Chris Cogdon wrote:
> On Feb 27, 2008, at 14:42 , Federico Di Gregorio wrote:
> > Yes. You need to explicitly close connection before the program exits
> > because Python does not destroy still-live objects.
>
> That's interesting... I thought it DID clean up "still-live" objects;
> as long as the objects have a __del__ method, python will call it on
> exit.
>
> Of course, if the process is kill'd, then all bets are off :)
>
> I ran a tiny experiment:
>
> * I created a database connection in the interactive shell, and ctrl-
> d'd the shell. No message.
>
> * Same thing if I used "raise SystemExit"
>
> * Then I created the connection again, and this time used kill -9 to
> kill the python process. I got the "unexpected EOF on client
> connection" message this time.
>
> * Same error message with a normal kill.
>
>
> Does that jibe  with people's experiences ?

I got similar results.  I also get an entry into the log
"Abort"  when I use connection.close().  But I don't get anything when I use 
del connection.


-- 
John Fabiani
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.