[ZODB-Dev] In-memory storage with undo ability?

Rooney, Mike (ext. 324) mxr at qvii.com
Mon Jan 15 15:49:05 EST 2007


>If Jim is not right (and "DemoStorage" does not support "undo"),
>then it would not be difficult to derive a "RamFileStorage" from
>"FileStorage" that exactly works like "FileStorage" but have its
>file implemented as a "StringIO" (rather than a file on the file system).

Thanks for the clever suggestion! I have implemented a StringIOStorage
with apparent success.

On another note, a problem appeared however when changing
the objects that were persisted and I assumed it to be the fault of
my StringIOStorage but when I tried reverting abd using a FileStorage
the same error occurred.

  File "C:\Documents and Settings\user\Desktop\smarttree-2.5\database.py", line 25, in commit
    transaction.commit()
  File "C:\python25\Lib\site-packages\transaction\_manager.py", line 99, in commit
    return self.get().commit(sub, deprecation_wng=False)
  File "C:\Python25\Lib\site-packages\transaction\_transaction.py", line 407, in commit
    self._commitResources()
  File "C:\Python25\Lib\site-packages\transaction\_transaction.py", line 506, in _commitResources
    rm.commit(self)
  File "C:\Python25\Lib\site-packages\transaction\_transaction.py", line 642, in commit
    self.manager.commit(o, txn)
  File "C:\Python25\Lib\site-packages\ZODB\DB.py", line 747, in commit
    tid, oids = self._db._storage.undo(self._tid, t)
  File "C:\python25\Lib\site-packages\ZODB\FileStorage\FileStorage.py", line 1117, in undo
    return self._txn_undo(transaction_id)
  File "C:\python25\Lib\site-packages\ZODB\FileStorage\FileStorage.py", line 1126, in _txn_undo
    tindex = self._txn_undo_write(tpos)
  File "C:\python25\Lib\site-packages\ZODB\FileStorage\FileStorage.py", line 1205, in _txn_undo_write
    raise MultipleUndoErrors(failures.items())
MultipleUndoErrors: Undo error 0x15e1: Undo error 0x15e1: _loadBack() failed

The actual line in FileStorage.py in _txn_undo_write that is raising the exception is:
	p, prev, v, snv, ipos = self._transactionalUndoRecord(h.oid, pos, h.tid, h.prev, h.version)

Since there is an error for this and the errors are put into a
dictionary and such, I assume this is not all that rare to
occur. Is there a common reason this happens that anyone might
be able to clue me in on?

Thanks,
Mike


More information about the ZODB-Dev mailing list