[z3-checkins] r22489 - z3/sqlos/branch/sqlos-zope2.8/src/sqlos

jinty at codespeak.net jinty at codespeak.net
Sun Jan 22 21:01:45 CET 2006


Author: jinty
Date: Sun Jan 22 21:01:44 2006
New Revision: 22489

Modified:
   z3/sqlos/branch/sqlos-zope2.8/src/sqlos/_transaction.py
Log:
Sometime obj has no id when a transaction is being rolled back.

Modified: z3/sqlos/branch/sqlos-zope2.8/src/sqlos/_transaction.py
==============================================================================
--- z3/sqlos/branch/sqlos-zope2.8/src/sqlos/_transaction.py	(original)
+++ z3/sqlos/branch/sqlos-zope2.8/src/sqlos/_transaction.py	Sun Jan 22 21:01:44 2006
@@ -46,8 +46,9 @@
     This function should not cause SQL to be sent as it is not defined whether
     the SQL connection will commit before or after this is executed.
     """
-    for connection in connCache.values():
-        connection.cache.expire(obj.id, obj.__class__)
+    if getattr(obj, 'id', None) is None:
+        for connection in connCache.values():
+            connection.cache.expire(obj.id, obj.__class__)
 
     # Expire object values. The transaction has either been aborted or
     # committed.


More information about the z3-checkins mailing list