[ZODB-Dev] InvalidObjectReference at commit

Christian Reis kiko at async.com.br
Fri May 9 10:40:15 EDT 2003


We ran into problems today while committing objects that held references
to objects in other connections. The following patch was quite useful in
helping us find out what was wrong; we just looked at what references
the object held and their _p_jars.

Is it something that would be appreciated in the tree?

Index: Connection.py
===================================================================
RCS file: /cvs-repository/ZODB3/ZODB/Connection.py,v
retrieving revision 1.91
diff -u -r1.91 Connection.py
--- Connection.py	23 Apr 2003 20:36:02 -0000	1.91
+++ Connection.py	9 May 2003 12:36:28 -0000
@@ -18,7 +18,8 @@
 from __future__ import nested_scopes
 
 from cPickleCache import PickleCache
-from POSException import ConflictError, ReadConflictError, TransactionError
+from POSException import ConflictError, ReadConflictError, TransactionError, \
+                         InvalidObjectReference
 from ExtensionClass import Base
 import ExportImport, TmpStore
 from zLOG import LOG, ERROR, BLATHER, WARNING
@@ -419,7 +435,14 @@
             seek(0)
             clear_memo()
             dump((klass,args))
-            dump(state)
+            try:
+                dump(state)
+            except InvalidObjectReference, e:
+                msg = ("While committing %s (oid %s) the connection %s "
+                       "raised an InvalidObjectReference: %s" 
+                       % (object, `oid`, self, e) )
+                LOG('ZODB', ERROR, msg)
+                raise
             p=file(1)
             s=dbstore(oid,serial,p,version,transaction)
             self._store_count = self._store_count + 1

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL



More information about the ZODB-Dev mailing list