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

Rafael Sierra rafaeljsg14 at gmail.com
Tue Mar 2 17:31:17 CET 2010


On Tue, Mar 2, 2010 at 12:47 PM, Denis Papathanasiou
<denis.papathanasiou at gmail.com> wrote:
>
>> That's odd...you already got that exception? Here I have only:
>>
>>>>> [p for p in dir(bsddb.db) if 'Error' in p]
>>
>> ['DBAccessError', 'DBAgainError', 'DBBusyError',
>> 'DBCursorClosedError', 'DBError', 'DBFileExistsError',
>> 'DBInvalidArgError', 'DBKeyEmptyError', 'DBKeyExistError',
>> 'DBLockDeadlockError', 'DBLockNotGrantedError', 'DBNoMemoryError',
>> 'DBNoServerError', 'DBNoServerHomeError', 'DBNoServerIDError',
>> 'DBNoSpaceError', 'DBNoSuchFileError', 'DBNotFoundError',
>> 'DBOldVersionError', 'DBPageNotFoundError', 'DBPermissionsError',
>> 'DBRepHandleDeadError', 'DBRepUnavailError', 'DBRunRecoveryError',
>> 'DBSecondaryBadError', 'DBVerifyBadError']
>
> In python, my list of exceptions is the same as yours.
>
> DB_READ_UNCOMMITTED is an error specific to transactions, and was
> illustrated in the C example on oracle's site.
>
> So I wondered if there was a pybsddb equivalent, or should I just use
> DBError?

I guess you should use DBError this time...=/

/usr/lib/python2.6/bsddb$ grep -i commit *
dbtables.py:        # DB_AUTO_COMMIT isn't a valid flag for env.open()
dbtables.py:            dbflags |= db.DB_AUTO_COMMIT
dbtables.py:            txn.commit()
dbtables.py:            txn.commit()
dbtables.py:                txn.commit()
dbtables.py:            txn.commit()
dbtables.py:                        txn.commit()
dbtables.py:                    txn.commit()
dbtables.py:            txn.commit()


>
> _______________________________________________
> pybsddb mailing list
> pybsddb at jcea.es
> https://mailman.jcea.es:28443/listinfo/pybsddb
> http://www.jcea.es/programacion/pybsddb.htm
>



-- 
Rafael Sierra
http://blog.stiod.com



More information about the pybsddb mailing list