By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,532 Members | 1,495 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,532 IT Pros & Developers. It's quick & easy.

Persistant dictionary with lockable elements

P: n/a
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

Jul 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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 'o****@xiludom.gro'.split('@')])"
Jul 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.