Determines whether the current transaction, in which an EAServer component participates, has been aborted.
TransactionServer objects
transactionserver.IsTransactionAborted ( )
Argument |
Description |
---|---|
transactionserver |
Reference to the TransactionServer service instance |
Boolean. Returns true if the current transaction has been aborted and false if it has not.
The IsTransactionAborted function allows a component to verify that the current transaction is still viable before performing updates to the database.The IsTransactionAborted function corresponds to the isRollbackOnly transaction primitive in EAServer.
The following example checks to see whether the transaction has been aborted. If it has not, it updates the database and calls EnableCommit. If it has been aborted, it calls DisableCommit.
// Instance variables: ids_datastore, ts Integer li_rc
long ll_rv
li_rc = this.GetContextService("TransactionServer", ts)
IF li_rc <> 1 THEN
// handle the error
END IF
...
IF ts.IsTransactionAborted() = FALSE THEN
ll_rv = ids_datastore.Update()
IF ll_rv = 1 THEN
ts.EnableCommit()
ELSE
ts.DisableCommit()
END IF
END IF