[Zodb-checkins] SVN: ZODB/branches/3.4/src/ZODB/tests/testConnectionSavepoint.py added explanatory text

Jim Fulton jim at zope.com
Sun Apr 24 10:48:15 EDT 2005


Log message for revision 30145:
  added explanatory text
  

Changed:
  U   ZODB/branches/3.4/src/ZODB/tests/testConnectionSavepoint.py

-=-
Modified: ZODB/branches/3.4/src/ZODB/tests/testConnectionSavepoint.py
===================================================================
--- ZODB/branches/3.4/src/ZODB/tests/testConnectionSavepoint.py	2005-04-24 14:35:49 UTC (rev 30144)
+++ ZODB/branches/3.4/src/ZODB/tests/testConnectionSavepoint.py	2005-04-24 14:48:15 UTC (rev 30145)
@@ -20,7 +20,20 @@
 import persistent.dict, transaction
 
 def testAddingThenModifyThenAbort():
-    """
+    """\
+
+We ran into a problem in which abort failed after adding an object in
+a savepoint and then modifying the object. The problem was that, on
+commit, the savepoint was aborted before the modifications were
+aborted.  Because the object was added in the savepoint, it's _p_oid
+and _p_jar were cleared when the savepoint was aborted.  The object
+was in the registered-object list.  There's an invariant for this
+lists that states that all objects in the list should have an oid and
+(correct) jar.
+
+The fix was to abort work done after he savepoint before aborting the
+savepoint.
+    
     >>> import ZODB.tests.util
     >>> db = ZODB.tests.util.DB()
     >>> connection = db.open()
@@ -35,7 +48,20 @@
 """
 
 def testModifyThenSavePointThenModifySomeMoreThenCommit():
-    """
+    """\
+
+We got conflict errors when we committed after we modified an object
+in a savepoint and then modified it some more after the last
+savepoint.
+
+The problem was that we were effectively commiting the object twice --
+when commiting the current data and when committing the savepoint.
+The fix was to first make a new savepoint to move new changes to the
+savepoint storage and *then* to commit the savepoint storage. (This is
+similar to thr strategy that was used for subtransactions prior to
+savepoints.)
+
+
     >>> import ZODB.tests.util
     >>> db = ZODB.tests.util.DB()
     >>> connection = db.open()



More information about the Zodb-checkins mailing list