SVN: ZODB/branches/zagy-lp509801/src/ZODB/tests/testblob.py added a testcase which shows the error

Christian Zagrodnick <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <20100611144442.75C9D94191__28969.7582288229$1276267490$gmane$org@cvs.zope.org>
Log message for revision 113354:
  added a testcase which shows the error
  
  

Changed:
  U   ZODB/branches/zagy-lp509801/src/ZODB/tests/testblob.py

-=-
Modified: ZODB/branches/zagy-lp509801/src/ZODB/tests/testblob.py
===================================================================
--- ZODB/branches/zagy-lp509801/src/ZODB/tests/testblob.py	2010-06-11 14:43:54 UTC (rev 113353)
+++ ZODB/branches/zagy-lp509801/src/ZODB/tests/testblob.py	2010-06-11 14:44:42 UTC (rev 113354)
@@ -563,6 +563,33 @@
     >>> db.close()
     """
 
+def savepoint_commits_without_invalidations_out_of_order():
+    """Make sure transactions with blobs can be commited without the
+    invalidations out of order error (LP #509801)
+
+    >>> bs = create_storage()
+    >>> db = DB(bs)
+    >>> conn = db.open()
+    >>> conn.root.b = ZODB.blob.Blob('initial')
+    >>> transaction.commit()
+    >>> conn.root.b.open('w').write('1')
+    >>> _ = transaction.savepoint()
+    >>> tm = transaction.TransactionManager()
+    >>> conn2 = db.open(transaction_manager=tm)
+    >>> conn2.root.b.open('w').write('2')
+    >>> _ = tm.savepoint()
+    >>> conn.root.b.open().read()
+    '1'
+    >>> conn2.root.b.open().read()
+    '2'
+    >>> tm.commit()
+    >>> transaction.commit()  # doctest: +IGNORE_EXCEPTION_DETAIL
+    Traceback (most recent call last):
+        ...
+    ConflictError: database conflict error...
+    >>> db.close()
+    """
+
 def savepoint_cleanup():
     """Make sure savepoint data gets cleaned up.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.