company logo

Using transactions

ODABA supports two basic types of transactions:

  • Read transaction
  • Update transaction

In order to cache application events, one may start a read transaction. More important are update transactions, which allow protecting changes from being stored to the database until the transaction is committed. Both types of transactions can be nested on any level of depth.

Moreover, ODABA supports transactions for optimizing complex operations by providing a transaction cache, which is an update transaction with limited capacity.

Since many operations as create or delete instances perform a number of internal actions, each updating ODABA function starts an internal transaction, which will rollback, when the action fails at a certain place (e.g. a duplicate key appears when maintaining the inverse relationship).

Since one cannot start an application transaction within an internal transaction