sidnt / lmdz

0 stars 0 forks source link

releasing a transaction handle #27

Open sidnt opened 4 years ago

sidnt commented 4 years ago

release the transaction handle:

The transaction handle may be discarded using mdb_txn_abort() or mdb_txn_commit().

the former will, effectively,

Abandon all the operations of the transaction instead of saving them.

and the latter, will, effectively

Commit all the operations of a transaction into the database.


sidnt commented 4 years ago

Avoid long-lived transactions.

  • Read transactions prevent reuse of pages freed by newer write transactions, thus the database can grow quickly.
  • Write transactions prevent other write transactions, since writes are serialized.