[Zope-DB] ZODB/ZEO question.

Chris Withers chris at simplistix.co.uk
Tue Apr 5 18:56:50 EDT 2005


Willadsens wrote:
> Chris, please help me understand how this makes a difference in ZODB.
> I currently store a persistent list in the ZODB as follows:
> root[db_name] = some list

What class do you use for the list?

I suspect root's class isn't too clever, but I can't remember...

> Are you suggesting that I store it in some other, nested dictionary off 
> of root, such as:
> root[db_name][listname] = some list

Yes, in particular:

from BTrees.OOBTree import OOBTree
root[db_name]=OOBTree()
root[db_name]['something']=your_list

the btrees implementations are specially designed to minimise the kind 
of conflict errors you've been experiencing. They work just like python 
dictionaries...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-DB mailing list