bsddb3 locking questions

Eric S. Johansson esj at harvee.org
Sat Dec 31 13:57:46 EST 2005


Eric S. Johansson wrote:
> are there any simple examples of how to do record locking with bsddb3?

got this far with sample code from the activeware site

filename = 'fruit'

# Get an instance of BerkeleyDB
db_env = db.DBEnv()
db.set_lk_detect(db.DB_LOCK_YOUNGEST)
db_env.open("/tmp/bsddb3",db.DB_INIT_LOCK|db.DB_CREATE)


db_env.lock_id()

stuck at lock_id().  it returns a 1 (failure according to the docs and 
there is no hint of where the lock id value is returned so I can use it 
in the lock_get call.  at least that is what I think I need to do.




More information about the Python-list mailing list