ZODB undo problems

erik_w erik.wilsher at iname.com
Wed Sep 19 08:49:51 CEST 2001


I thought transactions in ZODB was 'undoable'.  Still calling
db.undo() seems not to work (see below).  What have I missed?

PythonWin 2.1.1 (#20, Jul 20 2001, ...
Portions Copyright 1994-2001 Mark ....
>>> from ZODB import FileStorage, DB
>>> storage = FileStorage.FileStorage('slettes.zdb')
>>> db = DB(storage)
>>> conn = db.open()
>>> root = conn.root()
>>> db.supportsUndo()
1
>>> root['r1'] = 0
>>> for i in range(10):
... 	root['r1'] += 1
... 	get_transaction().commit()
... 	
>>> root['r1']
10
>>> undoID = db.undoLog(0,100)[0]['id']
>>> db.undo(undoID)
>>> root['r1']
10
>>>get_transaction().commit()  #do I need this?
>>> root['r1']
10
>>> #huh...

AMK's standalone ZODB, most recent version.

Anyone out there with good pointers to pages on ZODB programming? 
(in addition to those on amk.ca and zope.org).

    BR
    EW



More information about the Python-list mailing list