Commit aa1376f9 authored by Vincent Pelletier's avatar Vincent Pelletier

Forward abortVersion and commitVersion to app, and add consistency checks.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1811 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d4430574
...@@ -111,11 +111,13 @@ class Storage(BaseStorage.BaseStorage, ...@@ -111,11 +111,13 @@ class Storage(BaseStorage.BaseStorage,
def supportsTransactionalUndo(self): def supportsTransactionalUndo(self):
return True return True
@check_read_only
def abortVersion(self, src, transaction): def abortVersion(self, src, transaction):
return '', [] return self.app.abortVersion(src, transaction)
@check_read_only
def commitVersion(self, src, dest, transaction): def commitVersion(self, src, dest, transaction):
return '', [] return self.app.commitVersion(src, dest, transaction)
def __len__(self): def __len__(self):
return self.app.getStorageSize() return self.app.getStorageSize()
......
...@@ -962,6 +962,16 @@ class Application(object): ...@@ -962,6 +962,16 @@ class Application(object):
# should ask the primary master # should ask the primary master
return self.local_var.tid return self.local_var.tid
def abortVersion(self, src, transaction):
if transaction is not self.local_var.txn:
raise StorageTransactionError(self, transaction)
return '', []
def commitVersion(self, src, dest, transaction):
if transaction is not self.local_var.txn:
raise StorageTransactionError(self, transaction)
return '', []
def __del__(self): def __del__(self):
"""Clear all connection.""" """Clear all connection."""
# Due to bug in ZODB, close is not always called when shutting # Due to bug in ZODB, close is not always called when shutting
......
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