[Zodb-checkins] SVN: ZODB/trunk/src/persistent/wref.py Get commit from transaction.
Jim Fulton
jim at zope.com
Sat Oct 25 20:36:00 EDT 2008
Log message for revision 92550:
Get commit from transaction.
Changed:
U ZODB/trunk/src/persistent/wref.py
-=-
Modified: ZODB/trunk/src/persistent/wref.py
===================================================================
--- ZODB/trunk/src/persistent/wref.py 2008-10-25 13:53:32 UTC (rev 92549)
+++ ZODB/trunk/src/persistent/wref.py 2008-10-26 00:35:57 UTC (rev 92550)
@@ -19,6 +19,7 @@
__docformat__ = "reStructuredText"
from persistent import Persistent
+import transaction
WeakRefMarker = object()
@@ -60,7 +61,7 @@
>>> conn1 = db.open()
>>> conn1.root()['ob'] = ob
>>> conn1.root()['ref'] = ref
- >>> ZODB.tests.util.commit()
+ >>> transaction.commit()
If we open a new connection, we can use the reference:
@@ -73,7 +74,7 @@
But if we delete the referenced object and pack:
>>> del conn2.root()['ob']
- >>> ZODB.tests.util.commit()
+ >>> transaction.commit()
>>> ZODB.tests.util.pack(db)
And then look in a new connection:
@@ -180,7 +181,7 @@
>>> conn1.root()['d'] = d
>>> conn1.root()['p2'] = p2
>>> conn1.root()['p3'] = p3
- >>> ZODB.tests.util.commit()
+ >>> transaction.commit()
And things still work, as before:
@@ -210,7 +211,7 @@
from the dictionary:
>>> del conn2.root()['p2']
- >>> ZODB.tests.util.commit()
+ >>> transaction.commit()
And pack the database, so that the no-longer referenced p2 is
actually removed from the database.
More information about the Zodb-checkins
mailing list