Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ed6c560b
Commit
ed6c560b
authored
Jul 12, 2005
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced all commit(1) calls by savepoint() except of some ZODB unit tests
parent
be1a0d80
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
12 deletions
+16
-12
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+1
-1
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+2
-2
lib/python/Products/Five/tests/test_event.py
lib/python/Products/Five/tests/test_event.py
+3
-3
lib/python/Products/Sessions/tests/testSessionDataManager.py
lib/python/Products/Sessions/tests/testSessionDataManager.py
+4
-2
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+1
-1
lib/python/Products/ZODBMountPoint/MountedObject.py
lib/python/Products/ZODBMountPoint/MountedObject.py
+3
-3
No files found.
doc/CHANGES.txt
View file @
ed6c560b
...
...
@@ -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
...
...
lib/python/OFS/CopySupport.py
View file @
ed6c560b
...
...
@@ -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
,
(
...
...
lib/python/OFS/Image.py
View file @
ed6c560b
...
...
@@ -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
...
...
lib/python/Products/Five/tests/test_event.py
View file @
ed6c560b
...
...
@@ -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
...
...
lib/python/Products/Sessions/tests/testSessionDataManager.py
View file @
ed6c560b
...
...
@@ -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
)
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
ed6c560b
...
...
@@ -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
:
...
...
lib/python/Products/ZODBMountPoint/MountedObject.py
View file @
ed6c560b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment