>>>>> "Y" == Yukihiro Matsumoto <matz / netlab.co.jp> writes:

Y> I don't understand what your does.  Maybe I should learn more about bdb. 

 It can be written like this (well if I can write it :-))

  env.begin { |txn|    # begin a transaction
     b = txn.assoc(db) # associate a db handle with this transaction
     b["a"] = 12       # modify the database under transaction protection
     txn.abort         # abort the transaction (invalidate the change)
                       # or txn.commit to validate the modification
  }

 The transaction can be nested, i.e.

  env.begin(db) { |txn, b|
      txn.begin { |txn1|
       # ...
      }
  }

 you can also associate more than one db handle with one transaction.



Guy Decoux