[ZODB-Dev] [zodb4] calling get_transaction().abort() dies
Ury Marshak
um@hottech-israel.com
Tue, 10 Sep 2002 20:15:35 +0200
A simple attempt to call get_transaction().abort() fails with the following:
Traceback (most recent call last):
File "C:\WORk\test\tst.py", line 16, in ?
get_transaction().abort()
File "C:\Python22\Lib\site-packages\Transaction\Transaction.py", line 49,
in abort
self._manager.abort(self)
File "C:\Python22\Lib\site-packages\Transaction\Manager.py", line 82, in
abort
super(ThreadedTransactionManager, self).abort(txn)
File "C:\Python22\Lib\site-packages\Transaction\Manager.py", line 40, in
abort
r.abort(txn)
File "C:\Python22\Lib\site-packages\ZODB\Connection.py", line 497, in
abort
self._cache.invalidateMany(self._modified)
AttributeError: Connection instance has no attribute '_modified'
Wrong usage? If so, how can I abort the transaction and throw away all the
changes?
Sample code:
from ZEO import ClientStorage
from ZODB.DB import DB
import Persistence
from ZODB import FileStorage
from Transaction import get_transaction
if __name__=='__main__':
#
storage = FileStorage.FileStorage('ffff')
db = DB( storage )
conn = db.open()
root = conn.root()
root[1] = 1
get_transaction().abort()
OSes - win 2000, winXP, ZODB4 - current CVS, python 2.2.1
Ury