Transactions make it possible to alter, add or delete several database
records and guarantee that all changes, or no changes, will be accepted
by the database. A transaction object is basically a table object with
a few restrictions and additions, listed below:
- Purge is not available in a transaction object.
- Commit. In order to make all changes take affect, commit must be
issued at the end of a transaction sequence. Changes done by a
transaction object will never take affect before commit,
even if the database is shut down, the program crashes etc.
- Rollback. A rollback cancels all changes made by the transaction object.
Rollbacks always succeeds. However, with commit that is not always
the case. A commit will fail if:
- A record that is altered by the transaction object is altered
again by something else, before commit. This is called a conflict,
and will result in an error upon commit.
- Yabu.transaction.commit - Commit a transaction
This method commits the changes made in a transaction. If a record affected
by the transaction is altered during the transaction, a conflict will
arise and an error is thrown.
- SEE ALSO
- Yabu.table->transaction and Yabu.transaction->rollback
- Yabu.transaction.rollback - Rollback a transaction
This method cancels a transaction. All changes made in the transaction
- SEE ALSO
- Yabu.table->transaction and Yabu.transaction->commit