[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby-bdb transactions

snacktime

9/9/2006 8:51:00 PM

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 <em>BDB::Env#open</em> with the <em>BDB::INIT_TXN</em>
# flag (or <em>BDB::INIT_TRANSACTION</em>) 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

1 Answer

ts

9/10/2006 10:04:00 AM

0

>>>>> "s" == snacktime <snacktime@gmail.com> writes:

s> # The transaction subsystem is created, initialized, and opened by calls
s> # to <em>BDB::Env#open</em> with the <em>BDB::INIT_TXN</em>
s> # flag (or <em>BDB::INIT_TRANSACTION</em>) 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