Commit 2981441b authored by Yoshinori Okuji's avatar Yoshinori Okuji

Define _begin to define a commit hook on Zope 2.8.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4456 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4be6f805
......@@ -102,6 +102,15 @@ class UidBuffer(TM):
self.finished_buffer = []
self.allocated_buffer = {}
def _begin(self, *ignored):
# In Zope 2.8 (ZODB 3.4), use beforeCommitHook instead of
# patching Trasaction.
transaction = get_transaction()
try:
transaction.beforeCommitHook(self.tpc_prepare, transaction)
except AttributeError:
pass
def tpc_prepare(self, transaction, sub=None):
"""Mark used uids."""
tid = get_ident()
......
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