Commit ed6c560b authored by Christian Heimes's avatar Christian Heimes

Replaced all commit(1) calls by savepoint() except of some ZODB unit tests

parent be1a0d80
......@@ -38,6 +38,8 @@ Zope Changes
Bugs Fixed
- Replaced all transaction.commit(1) calls by transaction.savepoint()
- Collector #1832: UnIndex swallowed ConflictErrors.
- Collector #1815: ZCTextIndex accepts (again) sequences of strings to
......
......@@ -461,7 +461,7 @@ class CopySource(ExtensionClass.Base):
# 1) Make sure the data about to be exported is current
# 2) Ensure self._p_jar and container._p_jar are set even if
# either one is a new object
transaction.commit(1)
transaction.savepoint()
if self._p_jar is None:
raise CopyError, (
......
......@@ -516,7 +516,7 @@ class File(Persistent, Implicit, PropertyManager,
# Make sure we have an _p_jar, even if we are a new object, by
# doing a sub-transaction commit.
transaction.commit(1)
transaction.savepoint()
if self._p_jar is None:
# Ugh
......@@ -542,7 +542,7 @@ class File(Persistent, Implicit, PropertyManager,
data.next = next
# Save the object so that we can release its memory.
transaction.commit(1)
transaction.savepoint()
data._p_deactivate()
# The object should be assigned an oid and be a ghost.
assert data._p_oid is not None
......
......@@ -64,7 +64,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent(self.folder, 'foo', 'Foo')
# somehow we need to at least commit a subtransaction to make
# renaming succeed
transaction.commit(1)
transaction.savepoint()
self.folder.manage_renameObject('foo', 'bar')
bar = self.folder.bar
events = objectEventCatcher.getEvents()
......@@ -98,7 +98,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent(folder1, 'foo', 'Foo')
foo = folder1.foo
# need to trigger subtransaction before copy/paste can work
transaction.commit(1)
transaction.savepoint()
cb = folder1.manage_cutObjects(['foo'])
folder2.manage_pasteObjects(cb)
newfoo = folder2.foo
......@@ -128,7 +128,7 @@ class EventTest(FiveTestCase):
manage_addNoVerifyPasteFolder(self.folder, 'folder1')
folder1 = self.folder.folder1
# need to trigger subtransaction before copy/paste can work
transaction.commit(1)
transaction.savepoint()
cb = self.folder.manage_copyObjects(['foo'])
folder1.manage_pasteObjects(cb)
foo_copy = folder1.foo
......
......@@ -50,7 +50,7 @@ def _getDB():
root = conn.root()
app = Application()
root['Application']= app
transaction.commit(1)
transaction.savepoint()
_populate(app)
stuff['db'] = db
conn.close()
......@@ -190,7 +190,9 @@ class TestSessionManager(TestBase):
sd.set('foo', 'bar')
# TODO: transaction.commit() always returns None. Is that
# all this is trying to test?
self.failUnless(transaction.commit(1) == None)
#self.failUnless(transaction.savepoint() == None)
# XXX: with savepoints this test makes even less sense
transaction.savepoint()
def testForeignObject(self):
self.assertRaises(InvalidObjectReference, self._foreignAdd)
......
......@@ -586,7 +586,7 @@ class ZCatalog(Folder, Persistent, Implicit):
# we should commit a subtransaction if our threshhold is
# exceeded within the boundaries of the current transaction.
if self._v_total > self.threshold:
transaction.commit(1)
transaction.savepoint()
self._p_jar.cacheGC()
self._v_total = 0
if pghandler:
......
......@@ -54,7 +54,7 @@ class SimpleTrailblazer:
o = context.restrictedTraverse(id)
# Commit a subtransaction to assign the new object to
# the correct database.
transaction.commit(1)
transaction.savepoint()
return o
def traverseOrConstruct(self, path, omit_final=0):
......@@ -107,7 +107,7 @@ class CustomTrailblazer (SimpleTrailblazer):
obj = context.unrestrictedTraverse(id)
# Commit a subtransaction to assign the new object to
# the correct database.
transaction.commit(1)
transaction.savepoint()
return obj
......@@ -177,7 +177,7 @@ class MountedObject(MountPoint, SimpleItem):
obj = Application()
root[real_root] = obj
# Get it into the database
transaction.commit(1)
transaction.savepoint()
else:
raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment