db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB

Neville C. Dempsey nevillednz.python at 3ttechnology.com
Thu Oct 27 12:17:54 EDT 2005


Why does this python program fail to read record "6000000"?

#!/usr/bin/env python
import bsddb # twiceopen.py

key="6000000"
btf=bsddb.db.DB_INIT_THREAD

list1=bsddb.btopen("twiceopen.tbl",btflags=btf)
list1[key]="we have the technology"

list2=bsddb.btopen("twiceopen.tbl",btflags=btf)
#print "key:",key,"val:",list2[key] # doesn't work...
print "first:",list2.first() # also fails first time...

list1.close()
list2.close()

Maybe the solution needs one of: 
  db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB

N




More information about the Python-list mailing list