[Twisted-Python] Lock classes for berkely dbm files
Jp Calderone
exarkun at divmod.com
Sun Feb 13 22:16:37 MST 2005
On Sun, 13 Feb 2005 19:09:14 -0800, snacktime <snacktime at gmail.com> wrote:
>Anyone have any thoughts on using a lock class (using deferreds)
> versus the built in transaction/locking support in BerkeleyDB?
>
> My thought was this. It sure would be a lot simpler to just use a
> lock class and the python built in dbm functions than having to use
> the newer bsddb3 module and worry about BerkeleyDb environments and
> transactions.
>
> The application is transaction oriented, and each transaction would
> have one write and one read, each in a different lock.
>
> Anyone see any problems with using a lock class in this way?
Just that it totally won't work at all. Use the newer bsddb3
module, if you plan to use a string key/value mapping-oriented
data store.
To avoid worrying about bdb environments, you want the
DatabaseEnvironment class from this module:
http://divmod.org/cvs/*checkout*/trunk/atop/store.py?content-type=text%2Fplain&rev=7420
Specifically, the open() (and possibly join()) method.
Jp
More information about the Twisted-Python
mailing list