[Zope-dev] volatile state maintenance
Sam Gendler
sgendler@silcom.com
Mon, 10 Apr 2000 00:48:36 -0700
Toby Dickenson wrote:
>
> On Sun, 09 Apr 2000 22:56:05 -0700, Sam Gendler <sgendler@silcom.com>
> wrote:
>
> >Is there an opposite function to __setstate__, which would allow me to
> >close the connection before it gets blown away.
>
> You are looking for __del__
>
> Toby Dickenson
> tdickenson@geminidataloggers.com
Actually, I was thinking about a function that gets called just before
the object gets pickled for insertion into the ZODB, which would allow
me to set a 'connected' variable to some meaningfule value. Setting a
variable just before garbage collection is fairly meaningless. The
database connection already has a close call in the destructor.
--sam