MDB_txn Struct Reference
[LMDB Internals]

Opaque structure for a transaction handle. More...

Data Fields

MDB_txnmt_parent
MDB_txnmt_child
pgno_t mt_next_pgno
txnid_t mt_txnid
MDB_envmt_env
MDB_IDL mt_free_pgs
MDB_pagemt_loose_pgs
int mt_loose_count
MDB_IDL mt_spill_pgs
union {
   MDB_ID2L   dirty_list
   MDB_reader *   reader
mt_u
MDB_dbxmt_dbxs
MDB_dbmt_dbs
unsigned int * mt_dbiseqs
MDB_cursor ** mt_cursors
unsigned char * mt_dbflags
MDB_dbi mt_numdbs
unsigned int mt_flags
unsigned int mt_dirty_room

Detailed Description

Opaque structure for a transaction handle.

A database transaction. Every operation requires a transaction handle.

All database operations require a transaction handle. Transactions may be read-only or read-write.


Field Documentation

parent of a nested txn

Nested txn under this txn, set together with flag MDB_TXN_HAS_CHILD

next unallocated page

The ID of this transaction. IDs are integers incrementing from 1. Only committed write transactions increment the ID. If a transaction aborts, the ID may be re-used by the next writer.

the DB environment

The list of pages that became unused during this transaction.

The list of loose pages that became unused and may be reused in this transaction, linked through NEXT_LOOSE_PAGE(page).

The sorted list of dirty pages we temporarily wrote to disk because the dirty list was full. page numbers in here are shifted left by 1, deleted slots have the LSB set.

For write txns: Modified pages. Sorted when not MDB_WRITEMAP.

For read txns: This thread/txn's reader table slot, or NULL.

Array of records for each DB known in the environment.

Array of MDB_db records for each known DB

unsigned int* MDB_txn::mt_dbiseqs

Array of sequence numbers for each DB handle

In write txns, array of cursors for each DB

unsigned char* MDB_txn::mt_dbflags

Array of flags for each DB

Number of DB records in use, or 0 when the txn is finished. This number only ever increments until the txn finishes; we don't decrement it when individual DB handles are closed.

unsigned int MDB_txn::mt_flags
unsigned int MDB_txn::mt_dirty_room

dirty_list room: Array size - #dirty pages visible to this txn. Includes ancestor txns' dirty pages not hidden by other txns' dirty/spilled pages. Thus commit(nested txn) has room to merge dirty_list into mt_parent after freeing hidden mt_parent pages.


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 15 Feb 2016 for LMDB by  doxygen 1.6.1