Application Programming Interface Guide > Web Services Operations > Operations Reference > beginTransaction
 
beginTransaction
Start a transaction on the current session. The transaction continues until closeTransaction is invoked. Within a transaction, each operation that is invoked becomes a work unit that is part of the transaction. A transaction must be initiated before calling procedures like createExportArchive and createImportArchive. Later, closeTransaction must be called to COMMIT or ROLLBACK the work units.
When the transaction is closed using a ROLLBACK, all work units within the transaction are rolled back, if the work units support being rolled back.
When the transaction is closed using a COMMIT, all of the work units are committed. If a failure occurs doing the transaction commit, the server attempts to close the transaction using the technique specified by the transaction mode.
The transactionMode can include one of the following options that control compensation behavior:
BEST_EFFORT: If a failure occurs during commit, log that failure and continue to commit the remaining work units.
COMPENSATE: If a failure happens during commit, compensate all previously committed work units and rollback all work units that have not yet been committed. (Default value.)
NO_COMPENSATE: If a failure happens during commit, do nothing to previously committed work units and roll back all work units that have not yet been committed.
The transactionMode can also include one of the following options that controls the behavior if the server goes down:
FAIL_INTERRUPT: Log enough information so that when the server restarts it can compensate any work units that were committed before the interrupt.
IGNORE_INTERRUPT: Do no transaction logging. This option yields the best performance. (Default value.)
LOG_INTERRUPT: Log before the start of the commit and at key points within the commit, so that if an interrupt occurs, it can be reconstructed.
Location
/services/webservices/system/util/session/operations/
Request Elements
transactionMode (optional): A space-separated list of up to two options, one from each of these groups of three:
BEST_EFFORT, COMPENSATE, or NO_COMPENSATE
FAIL_INTERRUPT, IGNORE_INTERRUPT, or LOG_INTERRUPT
Request Example
<session:beginTransaction xmlns:session="http://www.compositesw.com/services/system/util/session">
<session:transactionMode>BEST_EFFORT IGNORE_INTERRUPT</session:transactionMode>
</session:beginTransaction>
Response Elements
N/A
Faults
IllegalArgument: If transactionMode contains modes that are not listed above or contains conflicting modes.
IllegalState: If a transaction is already open in the current session.