[pybsddb] Problem scanning large hashed database
Jesus Cea
jcea at argo.es
Fri Dec 5 00:22:44 CET 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
andrew wrote:
> I seem to have it sorted now. The problem was that my scanning code was
> specifying the following locks when opening the database:
>
> db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_INIT_LOG|db.DB_INIT_TXN|
> db.DB_INIT_LOCK|db.DB_RECOVER
>
> After actually reading the documentation, I stripped it right back to
> just:
>
> db.DB_INIT_MPOOL
>
> and all seemed to work fine.
I would say that opening a active transactional database in not
transactional mode is dangerous, at best. You probably are not seeing
any problem because your write traffic is low, but you are playing with
fire.
That said, initializing the handle with DB_RECOVER is wrong too. Only a
thread of control must be active in the environment, doing the
DB_RECOVER. If the database is actively used and you do DB_RECOVER in a
new one, only luck prevents disaster.
- --
Jesus Cea Avion _/_/ _/_/_/ _/_/_/
jcea at jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQCVAwUBSThmPZlgi5GaxT1NAQKZaAP5AbCFK57t3kUoMCHDJ+uqaIgLbhJAw3sf
LccN0WwsQ9fJeZqDCszbpRsIAbmpghc6/hWBHXBG58/HM4jftodpZ+e3/+fYLJMV
wEgPTldgjtp4+4FPrqKv5aaHPuGjRfYj+rizXUgEXvMI+Ws/hd6lpqlsxj0sX040
abVazvYHXjE=
=EMDW
-----END PGP SIGNATURE-----
More information about the pybsddb
mailing list