Persistant dictionary with lockable elements
Bruno Desthuilliers
onurb at xiludom.gro
Wed Jul 12 10:56:24 EDT 2006
Will McGugan wrote:
> Hi,
>
> I'd like to have a persistant dictionary in a server so that incoming
> requests acquire a specific Python object, do something with it then
> return. There wont be that many objects but it is the persistance that
> is important here, I want the information to survive server re-starts /
> crashes. The Shelve module seems ideal for this, but because the server
> will be multithreaded I would like to be able to lock individual
> elements of the shelve while they are being processed (not just the
> entire Shelve object).
>
> Is there some way of using Shelve like this, or should I just move to a
> more typical database solution?
You may want to try with the ZODB. Or with SQLite.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list
mailing list