DuroDBMS API  1.7
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

◆ RDB_begin_tx()

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.

Errors:
not_supported_error
parentp is not NULL and the underlying storage system does not support nested transactions.

The call may also fail for a system error.

Referenced by RDB_drop_db().

◆ RDB_commit()

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.

◆ RDB_rollback()

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.

Referenced by RDB_rollback_all().

◆ 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_tx_db()

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.

References RDB_alloc().

Referenced by RDB_drop_constraint(), RDB_get_update_op(), and RDB_get_update_op_by_args().

◆ RDB_tx_is_running()

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_define_subtype(), RDB_drop_op(), RDB_drop_table(), RDB_drop_type(), RDB_implement_type(), RDB_map_public_table(), and RDB_table_contains().