Terminating automatic transactions
- Last Updated: January 27, 2016
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
An automatic transaction remains active as long as the context of the transaction initiating procedure remains active and you do not otherwise terminate the transaction using a transaction handle method. Thus, you can terminate an automatic transaction using the following two techniques:
-
Explicit termination — You can explicitly terminate an
automatic transaction in the server session with a reference to the
SET-COMMIT( )method or theSET-ROLLBACK( )method, as shown:hTran = THIS-PROCEDURE:TRANSACTION. hTran:SET-COMMIT().hTran = THIS-PROCEDURE:TRANSACTION. hTran:SET-ROLLBACK().As long as an automatic transaction is open, you can execute any internal procedure of the transaction initiating procedure from any other procedure running in the server session. However, if no transaction is open, any such attempt to call these internal procedures from within the server session context returns an error. Without an open transaction, only a client application can call a remote internal procedure of the transaction initiating procedure (see Restarting automatic transactions for more information).
Note: You can determine whether an automatic transaction is open in a server session by either checking for an error after executing an internal procedure of the transaction initiating procedure or by checking the value of theTRANS-INIT-PROCEDUREattribute. -
Implicit termination — You can also terminate the automatic
transaction from either the client or the server session by deleting the proxy
procedure handle (on an ABL client) or the remote persistent procedure handle (on
the application server) of the transaction initiating procedure. If you delete the
transaction initiating procedure, the transaction commits or rolls back depending on
the value of the transaction handle
DEFAULT-COMMITattribute.