OSID Logo
OSID Specifications
transaction package
Version 3.1.0
Interfaceosid.transaction.TransactionSession
Implementsosid.OsidSession
Used Byosid.transaction.TransactionManager
osid.transaction.TransactionProxyManager
Description

The transaction session is coordinate transactions. A transaction session allows for Transactions to be added to the list of transactions it is managing. Upon a commit(), all registered transactions receive a prepare() and a commit(). Upon an abort() all registered transactions receive an abort(). A TransactionSession itself may implement transactions (as it is an OsidSession) as a means of enabling a form of federated transaction management.

Methodadd
Description

Adds a Transaction to be managed by this transaction service.

Parametersosid.transaction.Transactiontransaction the transaction to add
ErrorsALREADY_EXISTS transaction already added
ILLEGAL_STATE this transaction has ended
INVALID_ARGUMENT the session doesn't support transactions
NULL_ARGUMENT a null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
Methodcommit
Description

Commits the transaction and makes the state change(s) visible. This transaction is effectively closed and the only valid method that may be invoked is getState().

ErrorsILLEGAL_STATE this transaction has been committed or aborted
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
Provider Notes

prepare() should be invoked on all regstered transactions and iff all are successful should commit() be invoked on all registered transactions. In case of error on any prepare(), all transactions should be aborted. If an error occurs on a commit() after a transaction reported success on a prepare() after one or more transactions were already committed, then it is not ACID compliant and success should be assumed by committing the rest of the transactions. If a commit() error occurs when no transactions have been committed, then this operation should not proceed.

Methodabort
Description

Cancels this transaction, rolling back the queue of operations since the start of this transaction. This transaction is effectively closed and the only valid method that may be invoked is getState().

ErrorsILLEGAL_STATE this transaction has been committed or aborted
Compliancemandatory This method must be implemented.
Provider Notes

Invokes abort() on all registered transactions().

MethodgetState
Description

Gets the current state of this transaction.

Returnosid.transaction.TransactionState the current state of this transaction
ErrorsILLEGAL_STATE this transaction has been committed or aborted
Compliancemandatory This method must be implemented.