BerkeleyDB - How to use transactions with cursors?

Posted on Wed May 30 17:18:05 2007 by sambayer
How to use transactions with cursors?

Hi all -

I'm looking at the source code for the Perl BerkeleyDB module distributed with Berkeley DB 4.5.20 (version 0.30), and I can't figure out for the life of me how to duplicate the idiom

txn_begin() db_cursor(...txn...) do some stuff close cursor txn_commit()

in Perl. The db_cursor() function appears to use the txn associated with the DB object, which can't be right - this txn appears only to be set internally in my_db_open, and doesn't appear to be accessible, and txn_commit() is never called on it. What's up?

Thanks in advance -

Sam Bayer

Direct Responses: 5287 | Write a response