Ruby-bdb transactions

I want to make sure I’m not missing something here. The following
statement from docs/transactions.rb seems to state that BDB::INIT_TXN
and BDB::INIT_TRANSACTION are the same, and do not enable locking.

The transaction subsystem is created, initialized, and opened by calls

to BDB::Env#open with the BDB::INIT_TXN

flag (or BDB::INIT_TRANSACTION) specified.

Note that enabling transactions automatically enables

logging, but does not enable locking, as a single thread of control

that needed atomicity and recoverability would not require it.

However, in the source it shows this:

bdb.h:
#define BDB_INIT_TRANSACTION (DB_INIT_LOCK | DB_INIT_MPOOL |
DB_INIT_TXN | DB_INIT_LOG)

bdb.c:
rb_define_const(bdb_mDb, “INIT_TXN”, INT2FIX(DB_INIT_TXN));

Which would seem to me that BDB::INIT_TRANSACTION would give you the
standard bdb environment for transactions with locking, while
BDB::INIT_TXN is exactly the same as the bdb DB_INIT_TXN flag.

The test suite seems to back this up, but I just wanted to make sure
I’m not missing something.

Chris

“s” == snacktime [email protected] writes:

s> # The transaction subsystem is created, initialized, and opened by
calls
s> # to BDB::Env#open with the BDB::INIT_TXN
s> # flag (or BDB::INIT_TRANSACTION) specified.

Well in my language, which is not english nor french, this just mean
that
you can open a transaction with the flag BDB::INIT_TXN or
BDB::INIT_TRANSACTION. This does not means that these 2 flags are the
same.

s> Which would seem to me that BDB::INIT_TRANSACTION would give you the
s> standard bdb environment for transactions with locking, while
s> BDB::INIT_TXN is exactly the same as the bdb DB_INIT_TXN flag.

yes, this is just that I find easier to write

BDB::INIT_TRANSACTION

rather than

BDB::INIT_LOCK | BDB::INIT_MPOOL | BDB::INIT_TXN | BDB::INIT_LOG

Guy Decoux