[Twisted-Python] Lock classes for berkely dbm files
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? Chris
On Sun, 2005-02-13 at 19:09 -0800, snacktime wrote:
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 Python built in dbm functions use gdbm or an old version of bsddb or a broken python dbm. They are half broken or worse. They will corrupt your data when your program or machine crashes.
On Sun, 13 Feb 2005 19:09:14 -0800, snacktime <snacktime@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
participants (3)
-
Itamar Shtull-Trauring
-
Jp Calderone
-
snacktime