THROW ROLLBACK
status | = any numeric expresion reducing to a KDB error code |
conn | = any numeric expression reducing to a database connection handle |
THROW ROLLBACK allows a program to abandon the transaction specified by the optional connection number. If no connection number is specified then it will be assumed to be with respect to the default connection. It is an error to issue a THROW ROLLBACK outside of a WHILE TRANS ... END TRANS block. The database update will be abandoned and control will resume after the END TRANS for the outermost matching transaction though FINALLY blocks may be executed to provide explicit tidy up code.
The KDB status code specified will be used to update the WHILE TRANS status code for the outermost WHILE TRANS.I t is expected that the application will check this status to determine if the transaction succeeded and to handle failure if it was rolled back. It should be a valid KDB error code but its value is not checked by the THROW statement other than to verify it is not _KE_SUCCESS.
Compatibility
THROW ROLLBACK, together with WHILE TRANS was introduced in KCML 6.60.
See also: