On 20.03.2008, at 07:07, Yuan HOng wrote:
Now comes the part that I can not understand. This simultaneous adding
to the BTree seem to cause the conflict error, since the BTree and
Bucket are also persistent object themselves. This would mean that
ZODB is not suitable for the cases of simultanous adding to a BTree by
multiple threads, like in my case for session data.


But since ZODB and zope.session are so widely used, I can not image
that this could be the case, otherwise how can anyone be reliably
using ZODB for session? So I must be missing some very important

it is the case ... there are two workarounds imho

don't write to the session if it does not change, so if you do an apache bench without sending the client id cookie, a write is done on each request

additionally every anonymous visit writes to zodb, you should avoid this by using default values if no session data is available

in earlier versions of zope the __getitem__ method created a btree at first access, but this should be fixed now, so it depends on the version of zope u use, if you have an older version then you can't even look if data is there without writing to zodb

my recommendation is to use memcached for session data ... take a look at http://svn.zope.org/repos/main/lovely.memcached/trunk

regards, bernd

Lovely Systems, senior developer

phone: +43 5572 908060, fax: +43 5572 908060-77
Schmelzhütterstraße 26a, 6850 Dornbirn, Austria
skype: bernd.dorn

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Zope3-users mailing list

Reply via email to