Working with transactions v15
There might be times when you want all updates to a database to occur successfully or for none to occur in case of any error. A set of database updates that occur successfully as a single unit or not at all is called a transaction.
A common example in banking is a funds transfer between two accounts. The two parts of the transaction are the withdrawal of funds from one account and the deposit of the funds in another account. Both parts of this transaction must occur for the bank’s books to balance. The deposit and withdrawal are one transaction.
You can create an SPL application that uses a style of transaction control compatible with Oracle databases if the following conditions are met:
edb_stmt_level_txparameter is set to
TRUE. This prevents the action of unconditionally rolling back all database updates in the
BEGIN/ENDblock if any exception occurs.
- The application isn't running in autocommit mode. If autocommit mode is on, each successful database update is immediately committed and can't be undone. The manner in which autocommit mode is turned on or off depends on the application.
The three main transaction commands are COMMIT, ROLLBACK, and PRAGM_AUTONOMOUS_TRANSACTION.
commit rollback pragma_autonomous_transaction