[pybsddb] Checking put() transaction results: what is the proper way in bsddb3?

Jesus Cea jcea at jcea.es
Wed Feb 17 17:40:16 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/20/2009 04:38 PM, Denis Papathanasiou wrote:
> In the Oracle documentation, when a put() method is called with a
> transaction (DBTxn) object, the integer return value is used to
> determine the state of the transaction.
> 
> I.e., if put() returns 0, it's ok to commit, whereas other values mean
> about or retry:
> http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_txn/C/txnexample_c.html
> 
> 
> Under bsddb3, it seems that put() does not return a value, even when
> passed a DBTxn object.

Sorry for the late replying.

Under Python, exceptional situations are handled raising exceptions.

Por example, a duplicated key (when asking for not overwriting) raises
DBKeyExistError. A deadlock raises DBLockDeadlockError, etc.

- -- 
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.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQCVAwUBS3wb8Jlgi5GaxT1NAQItSgP+Is0lolCZUmnfuXcTN2SLrMUaCKdhJgl8
5pOnJQcTUY5PVJ8EF87m7z1HQLgQ+nYkZHLDdCAQJcV0wUOM758NknGmIHPb2L4J
E+8qwO6V4Owpupt58oDgaoGmRzNDN9+riHuHufhI1C/+5cN+vr9WnBgi8ildi65K
q+8ctMwEsP8=
=zU33
-----END PGP SIGNATURE-----



More information about the pybsddb mailing list