DuroDBMS API  1.2
Functions
Transaction functions

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)
 
RDB_database * RDB_tx_db (RDB_transaction *txp)
 

Detailed Description

Function Documentation

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

Start a transaction which interacts with the database *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.

Referenced by RDB_drop_db(), and RDB_multi_assign().

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:
no_running_tx_error
txp does not point to a running transaction.

The call may also fail for a system error.

References RDB_raise_no_running_tx().

Referenced by RDB_drop_db(), RDB_get_dbs(), and RDB_multi_assign().

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:
no_running_tx_error
txp does not point to a running transaction.

The call may also fail for a system error.

References RDB_raise_no_running_tx().

Referenced by RDB_drop_db(), RDB_get_dbs(), RDB_multi_assign(), and RDB_rollback_all().

int RDB_rollback_all ( RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

Aborts the transaction *txp and all parent transactions.

References RDB_rollback().

RDB_database* RDB_tx_db ( RDB_transaction *  txp)

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

Returns

A pointer to the RDB_database structure that represents the database.

Referenced by RDB_add_table(), RDB_create_constraint(), RDB_create_table_index(), RDB_drop_constraint(), RDB_drop_table_index(), RDB_get_table(), RDB_get_update_op(), RDB_get_update_op_by_args(), RDB_multi_assign(), and RDB_set_table_name().

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.

Referenced by RDB_add_table(), RDB_create_ro_op_version(), RDB_define_subtype(), RDB_drop_op(), RDB_drop_table(), RDB_drop_type(), RDB_implement_type(), RDB_map_public_table(), RDB_multi_assign(), RDB_subset(), and RDB_table_contains().