restart transaction(1) — Commands
Digital
NAME
RESTART TRANSACTION − a statement in a task that raises a transient transaction exception
SYNOPSIS
[<label-name>:] RESTART TRANSACTION WITH
{ CLASS { <class-identifier> | <class-number> } |
CODE { <message-identifier> | <message-number> }
[ IN { <message-group-uuid> | <message-group-name> } ]
} ;
PARAMETERS
•label-name
An internal unqualified identifier associated with the statement, for use in flow control operations.
•class-identifier
One of the standard, predefined exception classes. The exception classes and their equivalent class-number values are:
FATAL-TIMEOUT-FAULT -1 ENV-INVOCATION-ERROR 1
FATAL-EXECUTION-FAULT -2 TXN-FAILURE-ERROR 2
AP-INVOCATION-FAULT -3 AP-INCOMPLETE-ERROR 3
ENV-INVOCATION-FAULT -4 TXN-TIMEOUT-ERROR 4
AP-RESPONSE-FAULT -5 TXN-INCOMPLETE-ERROR 5
AP-EXECUTION-FAULT -6 ENV-EXECUTION-ERROR 6
ENV-EXECUTION-FAULT -7 REQUEST-TIMEOUT-ERROR 7
AP-PROCESSING-FAULT -9 INVALID-INPUT-ERROR 8
ENV-UNSPECIFIED-FAULT -10 NO-OUTPUT-ERROR 9
Faults indicate exceptions that require modifying the source file or environment information. Fault values are expressed in negative numbers.
Errors indicate exceptions for operations that may be successful if retried, without modifying a source file or environment information. In some cases, data must be modified. Error values are expressed in positive numbers.
•class-number
Either an integer workspace field or an integer literal giving a value assigned to an exception class.
•message-identifier
A name associated with the message number, class identifier, and message text in a message group definition associated with this task definition. Use either the message identifier or the message number to raise the exception.
•message-number
Either an integer workspace field or an integer literal giving the integer value assigned to a message identifier by VALUE IS in the message group definition. Use either the message identifier or the message number to raise the exception with CODE.
•message-group-uuid
Either a UUID-workspace field or a UUID-string literal that uniquely identifies the message group.
If you do not specify a uuid value, the default value is zero.
•message-group-name
An unqualified external identifier giving the name of a message group in which the application-defined exception code is stored.
DESCRIPTION
Use the RESTART TRANSACTION statement only in a task with the RESTARTABLE task attribute. (If the task is nonrestartable, ACMSxp software treats any transaction exception as a permanent transaction exception.)
If RESTART TRANSACTION is used in a noncomposable task, it must be inside a transaction block.
A transient transaction exception relates to an error that might not recur if a transaction is retried with the same data (for example, a deadlock). Thus, if the task is noncomposable, this type of exception causes the system to roll back the transaction and automatically retry the transaction.
You can also restart a transaction by using the RAISE EXCEPTION statement to raise a transient transaction exception in a restartable task.
If you specify EXCEPTION CLASS, ACMSxp software checks that the exception class is one of the standard predefined exception classes, and sets the exception code to 0.
If you specify EXCEPTION CODE, ACMSxp software maps the exception code to the appropriate exception class as defined in the related message group definition, which must have a message number equivalent to the exception code supplied with EXCEPTION CODE clause.
IN specifies the exception code group for a system-defined exception code or the message group for an application- defined exception code. If IN is omitted, the exception code must belong to a message group with a UUID of all zeroes.
RESTART TRANSACTION determines the class and code of the exception to be raised and completes with a transient transaction exception, regardless of the type of exception associated with the exception class.
If an exception occurs, the RESTART TRANSACTION completes with that exception. For information on the run-time aspects of restartable tasks, see ACMSxp Developing and Managing Applications
EXCEPTIONS
The RESTART TRANSACTION statement can generate the AP-EXECUTION-FAULT exception class. The AP-EXECUTION-FAULT exception class indicates one of the following error conditions:
oThe subscript used to refer to an element in a fixed-length array is invalid (referring to A(n) where n is less than one or n is greater than the maximum size of array).
oThe subscript used to refer to an element in a variable-length array is invalid (referring to A(n) where n is less than one or n is greater than the value of the DEPENDING ON field).
oThe value of the DEPENDING ON field used when referring to an element of a variable-length array is invalid (the value of the DEPENDING ON field is less than the minimum size of the array or the value of the DEPENDING ON field is greater than the maximum size of array).
oThe exception code specified in the RESTART TRANSACTION statement is not defined within an associated message group definition.
oThe exception class specified in the RESTART TRANSACTION statement is not one of the standard predefined exception classes.
oThe value of the message group UUID specified did not match a known exception group or the value of the message group name did not match a known message group definition.
RELATED INFORMATION
Syntax: exception(1), exception_handler(1), raise_exception(1), reraise_exception(1), task_definition(1)