bsddb question

Paul Rubin phr-n2003b at NOSPAMnightsong.com
Sun Feb 2 22:00:40 EST 2003


"dsavitsk" <dsavitsk at e-coli.net> writes:
> "The shelve module does not support concurrent read/write access to shelved
> objects. When a program has a shelf open for writing, no other program
> should have it open for reading or writing."
> 
> is bsddb safe to use for this?  of is there another option like embedding
> commands in a Queue object?

Plain bsddb isn't.  Download and use bsddb3 and read the docs
carefully.  Or you use queues (or whatever) to serialize access to a
shelve or dbm database, which avoids simultaneous access as long as
all your threads are in a single process.

If you're trying to write a cgi that accesses the database but could
conceivably be running from multiple processes simultaneously, of
course serializing with queues doesn't really work.  Bsddb3 isn't a
perfect answer, but it's at least sort of reasonable.




More information about the Python-list mailing list