[Zope] [Further investigations] Re: A question about __setstate__ in Shared/DC/ZRDB/Connection.py
Dieter Maurer
dieter at handshake.de
Sat Sep 20 02:24:40 EDT 2008
Tres Seaver wrote at 2008-9-19 09:33 -0400:
> ...
>There is a special 'STICKY' state which prevents ghostifying, but it
>can't be set from Python code. You could, however, set '_p_changed' on
>the connection at the beginning of the method, and then delete it at the
>end: changed objects can't be ghostified. E.g.:
>
> def my_method(self):
> self.connection._p_changed = 1
> try:
> self.sql()
> # now do the stuff which used to ghostify the connection
> finally:
> del self.connection._p_changed
Are you sure that this works?
According to my (not very clear) memory, "_p_changed" in a C level attribute
(that is definite) which could be set to "1" from application level
but not reset (that is not sure).
--
Dieter
More information about the Zope
mailing list