Re: Persistant dictionary with lockable elements

2006-07-12 Thread Bruno Desthuilliers
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 '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


Persistant dictionary with lockable elements

2006-07-12 Thread Will McGugan
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

-- 
http://mail.python.org/mailman/listinfo/python-list