Table of Contents

Transaction Control

The Open-ILS Storage server supports database level transactions that are performed within one OpenSRF Session. This transaction control allows atomic updates of multiple objects to be applied simultaniously without the worry of users getting broken or incomplete data due to timing issues or errors unrelated to their own queries and transactions. In order to support truely atomic transactions the database that backs the Storage server must support tranactions, but if it does not these methods will become a no-op.

Because the Storage server needs to support different types of replication systems (Multi-master, Single-master multi-slave, XA-base distributed transactions, etc.), you should wrap all write calls, such as create, update and delete, in a transaction. This will allow the Driver to detect when it should be directing a query to the master database in a single-master replication scheme.

open-ils.storage.transaction.begin

Starts a database transaction if supported by the current Storage Driver.

open-ils.storage.transaction.commit

Commits the current transaction to the database.

open-ils.storage.transaction.current

Retrieves the current transaction ID. This is generally Driver dependant.

open-ils.storage.transaction.rollback

Rolls back the current database transaction.


TODO