Documented in Readme of Clarion 11.13371 Feb 6, 2019.
FEATURE: You can now trap calls to the transaction handling functions LOGOUT, COMMIT, and ROLLBACK without having to attach a file callback to every file. To do this you use SYSTEM{PROP:TransactionHook}. You set this property to the address of a function that has the prototype:
FUNCTION(SIGNED opCode, LONG state, *FILE file, *LONG stop, *CSTRING FileErrCode, *CSTRING FielErrMsg),LONG
This function will be called at least 3 times for each operation.
- Once at the start of the operation (in this case state = TRANSTATE:STARTING),
- Once for each file in the transaction (in this case state = TRANSTATE:HAVEFILE), and
- Once at the end of the operation (in this case state = TRANSTATE:ENDING)
The opCode (SIGNED opCode) can be set to DriverOp:LOGOUT, DriverOp:COMMIT, or DriverOp:ROLLBACK
The file parameter (*FILE file) will be assigned to one of the files in the transaction if state = TRANSTATE:HAVEFILE.
Setting stop to TRUE (*LONG stop) will cause the RTL to stop execution of normal transaction handling code after this function exits
Setting FileErrorCode and FileError (*CSTRING FileErrCode and *CSTRING FielErrMsg) will set FILEERRORCODE() and FILEERROR() respectively.
The return value is the ERRORCODE() that the operation should set. This function must return 0 if no error is to be reported.