[ZODB-Dev] How to predict George Bailey?
Toby Dickenson
tdickenson@geminidataloggers.com
Sat, 2 Nov 2002 20:33:29 +0000
On Saturday 02 November 2002 1:13 am, Magnus Lycka wrote:
> (As far as I see, only G.B'd
> objects will cause closed windows.)
Suppose some other concurrent transaction logically deletes an object for=
=20
which you have an open window. You wont get exceptions immediately becaus=
e=20
the historical revisions will still be in the database.
However suppose the database is concurrently packed. Your object is no lo=
nger=20
reachable from the root, therefore it is liable for removal. You may then=
get=20
exceptions exactly the same as for a George Bailey object.
Are you aware that there is a fundamental difference between the way you =
are=20
using ZODB, and the usage patterns of Zope? Zope *never* holds on to an=20
object reference across a transaction boundary. Im not sure whether this =
is a=20
'rule' or merely a 'characteristic' (Jim?), but I think it has severe=20
implications..... Check out the old threads about dangling references for=
=20
examples of the problems that you are exposed to, but Zope is not.
> >what triggers the event to which the observers subscribe? why can it h=
andle
> >some types of changes but not others?
> __setattr__ in persistent objects, and methods such as remove and
> __delattr__ etc in a subclass of PersistentList.
Ive detected similar cases by adding a special object as a _v_attribute, =
and=20
used the __del__ of this object to detect deactivation. Maybe that would=20
help?