20 Sep
2008
20 Sep
'08
6:24 a.m.
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