Transaction functions


Defines

#define RDB_tx_db(txp)   ((txp)->dbp)
#define RDB_tx_env(txp)   ((txp)->envp)

Functions

int RDB_begin_tx (RDB_exec_context *ecp, RDB_transaction *txp, RDB_database *dbp, RDB_transaction *parentp)
int RDB_commit (RDB_exec_context *ecp, RDB_transaction *txp)
int RDB_rollback (RDB_exec_context *ecp, RDB_transaction *txp)
int RDB_rollback_all (RDB_exec_context *ecp, RDB_transaction *txp)
RDB_bool RDB_tx_is_running (RDB_transaction *txp)

Define Documentation

#define RDB_tx_db ( txp   )     ((txp)->dbp)

Return the database the transaction pointed to by txp interacts with.

Returns:
A pointer to the RDB_database structure that represents the database.

#define RDB_tx_env ( txp   )     ((txp)->envp)

Return the database environment associated with the transaction.

Returns:
A pointer to the RDB_environment structure representing the database environment.


Function Documentation

int RDB_begin_tx ( RDB_exec_context *  ecp,
RDB_transaction *  txp,
RDB_database *  dbp,
RDB_transaction *  parentp 
)

RDB_begin_tx starts a transaction which interacts with the database specified by dbp.

If parentp is not NULL, the new transaction is a subtransaction of the transaction specified by parentp.

The execution of a parent transaction is suspended while a child transaction executes. It is an error to perform an operation under the control of a transaction which has a running child transaction.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

The call may fail for a system error.

int RDB_commit ( RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_commit commits the transaction pointed to by txp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_NO_RUNNING_TX_ERROR
txp does not point to a running transaction.

The call may also fail for a system error.

int RDB_rollback ( RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_rollback terminates the transaction pointed to by txp and rolls back all changes made by this transaction and its subtransactions.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_NO_RUNNING_TX_ERROR
txp does not point to a running transaction.

The call may also fail for a system error.

RDB_bool RDB_tx_is_running ( RDB_transaction *  txp  ) 

RDB_tx_is_running returns if txp points to a running transaction.

Returns:
RDB_TRUE if the transaction is running, RDB_FALSE otherwise.


Generated on Tue Mar 11 23:48:15 2008 for Duro by  doxygen 1.5.1