[Zope-dev] RAMSessionDataContainer: broken?

Marius Gedminas marius at gedmin.as
Wed Jan 5 13:24:56 EST 2011


Is anyone using RAMSessionDataContainer?  I've a suspicion that it is
utterly broken with modern ZODB versions.

If I'm not mistaken, MVCC requires you to either call connection.sync()
or open a new connection for every request -- otherwise MVCC
invalidations don't get processed and you always see old versions of
cached objects.

RAMSessionDataContainer keeps an open connection for every thread, and
that connection is never closed, never synced.  This results in lots of
fun conflict errors, e.g.:

2011-01-05T10:42:21 WARNING ZopePublication Competing writes/reads at {URL}: database conflict error (oid 0x54, class BTrees.OOBTree.OOBTree, serial this txn started with 0x038b65ac32bee222 2011-01-05 15:40:11.893509, serial currently committed 0x038b65ae561f1999 2011-01-05 15:42:20.184723)
------
2011-01-05T10:42:21 WARNING ZopePublication Competing writes/reads at {URL}: database conflict error (oid 0x54, class BTrees.OOBTree.OOBTree, serial this txn started with 0x038b65ac32bee222 2011-01-05 15:40:11.893509, serial currently committed 0x038b65ae561f1999 2011-01-05 15:42:20.184723)
------
2011-01-05T10:42:21 WARNING ZopePublication Competing writes/reads at {URL}: database conflict error (oid 0x54, class BTrees.OOBTree.OOBTree, serial this txn started with 0x038b65ac32bee222 2011-01-05 15:40:11.893509, serial currently committed 0x038b65ae561f1999 2011-01-05 15:42:20.184723)
------
2011-01-05T10:42:21 WARNING ZopePublication Competing writes/reads at {URL}: database conflict error (oid 0x54, class BTrees.OOBTree.OOBTree, serial this txn started with 0x038b65ac32bee222 2011-01-05 15:40:11.893509, serial currently committed 0x038b65ae561f1999 2011-01-05 15:42:20.184723)
------
2011-01-05T10:42:21 ERROR SiteError {URL}
Traceback (most recent call last):
  File "/home/zope/eggs/zope.publisher-3.12.4-py2.6.egg/zope/publisher/publish.py", line 137, in publish
    publication.afterCall(request, obj)
  File "/home/zope/eggs/zope.app.publication-3.12.0-py2.6.egg/zope/app/publication/browser.py", line 48, in afterCall
    super(BrowserPublication, self).afterCall(request, ob)
  File "/home/zope/eggs/zope.app.publication-3.12.0-py2.6.egg/zope/app/publication/zopepublication.py", line 215, in afterCall
    txn.commit()
  File "/home/zope/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 329, in commit
    self._commitResources()
  File "/home/zope/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 443, in _commitResources
    rm.commit(self)
  File "/home/zope/eggs/ZODB3-3.9.7-py2.6-linux-i686.egg/ZODB/Connection.py", line 566, in commit
    self._commit(transaction)
  File "/home/zope/eggs/ZODB3-3.9.7-py2.6-linux-i686.egg/ZODB/Connection.py", line 614, in _commit
    self._store_objects(ObjectWriter(obj), transaction)
  File "/home/zope/eggs/ZODB3-3.9.7-py2.6-linux-i686.egg/ZODB/Connection.py", line 666, in _store_objects
    s = self._storage.store(oid, serial, p, '', transaction)
  File "/home/zope/eggs/ZODB3-3.9.7-py2.6-linux-i686.egg/ZODB/utils.py", line 255, in __call__
    return func(*args, **kw)
  File "/home/zope/eggs/ZODB3-3.9.7-py2.6-linux-i686.egg/ZODB/MappingStorage.py", line 258, in store
    oid=oid, serials=(old_tid, serial), data=data)
ConflictError: database conflict error (oid 0x54, class BTrees.OOBTree.OOBTree, serial this txn started with 0x038b65ac32bee222 2011-01-05 15:40:11.893509, serial currently committed 0x038b65ae561f1999 2011-01-05 15:42:20.184723)

Note how "serial this txn started with" doesn't change in all the
retries.

Does this sound plausible, or am I speaking nonsense?

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20110105/de149c36/attachment.bin 


More information about the Zope-Dev mailing list