Controlling the transaction
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
You can access the transaction object handle for the initialized transaction
object using the TRANSACTION attribute on the procedure
handle of any procedure executing in the server session by using the THIS-PROCEDURE system handle, as shown:
|
You can then access the transaction object methods and attributes to control the transaction, as described in the following table.
| Method/Attribute | Return/Data type | Description |
|---|---|---|
DEFAULT-COMMIT
|
LOGICAL
|
A writable attribute whose setting tells the
transaction object how to complete any open automatic transaction
if the transaction terminates with no prior invocation of the SET-COMMIT( ) or SET-ROLLBACK( ) method
(for example, if the transaction initiating procedure is deleted).
Setting it to TRUE ensures that the transaction
is committed. Setting it to FALSE ensures that
the transaction is rolled back. The default value is FALSE. |
IS-OPEN
|
LOGICAL
|
A read-only attribute that returns TRUE if
a transaction is active. The function of this attribute is identical
to the ABL TRANSACTION function. See also the TRANS-INIT-PROCEDURE attribute. |
SET-COMMIT( )
|
LOGICAL
|
Tells the transaction object to commit any active automatic
transaction after the current request returns execution to the client. If no automatic
transaction is active, the method returns FALSE.Note that you
cannot invoke this method after invoking a prior
|
SET-ROLLBACK( )
|
LOGICAL
|
Tells the transaction object to roll back any active automatic
transaction after the current request returns execution to the client. If no automatic
transaction is active, the method returns FALSE.Note that you
can invoke this method after invoking a prior
|
TRANS-INIT-PROCEDURE
|
HANDLE
|
A read-only attribute that returns the procedure
handle to the transaction initiating procedure for any active automatic
transaction. If no automatic transaction is active this attribute returns
an invalid handle. (Validate with the VALID-HANDLE function.) |