[Zope] [Further investigations] Re: A question about __setstate__ in Shared/DC/ZRDB/Connection.py

Marco Bizzarri marco.bizzarri at gmail.com
Sat Sep 20 02:42:47 EDT 2008


On Sat, Sep 20, 2008 at 8:24 AM, Dieter Maurer <dieter at handshake.de> wrote:
> 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
> _______________________________________________



As I said in my previous post, I modified my test case to check if
this works, but I'm afraid it does not (i.e. I can still see two
connections at the database).

Regards
Marco


-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/


More information about the Zope mailing list