Description
Declares that a component's work may be incomplete but its transaction updates are consistent and can be committed.
Applies to
TransactionServer objects
Syntax
transactionserver.EnableCommit ( )
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs.
Usage
The EnableCommit function indicates that the component should not be deactivated after the current method invocation. However, if the component instance is deactivated, the current transaction can be committed.
Examples
The following example shows the use of EnableCommit in a component method that performs database updates:
// Instance variables: // DataStore ids_datastore // TransactionServer ts Integer li_rc long ll_rv li_rc = this.GetContextService("TransactionServer", ts) IF li_rc <> 1 THEN // handle the error END IF ... ll_rv = ids_datastore.Update() IF ll_rv = 1 THEN ts.EnableCommit() ELSE ts.DisableCommit() END IF
See also
IsInTransaction (obsolete)
IsTransactionAborted (obsolete)