Persistant dictionary with lockable elements

Will McGugan will at willmcgugan.com
Wed Jul 12 10:47:46 EDT 2006


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?

Thanks,

Will McGugan
http://www.willmcgugan.com




More information about the Python-list mailing list