Transaction Error Handler Rule Function
You can create a transaction error handler callback rule function that enables you to identify which post RTC transactions failed or which events were not sent out during the post RTC phase. The transaction error handler rule function is invoked each time a database transaction exception occurs, and each time a send event exception occurs.
This feature requires cache-aside database write strategy. When backing store is enabled, the default value for the property Agent.agentclassname.enableParallelOps is true. The feature is not supported when the property value is set to false:
Agent.agentclassname.enableParallelOps=false
Set these two values to true explicitly in the CDD file in order to use the transaction error handler rule function.
The error handler rule function provides full details of the failed transactions. The transaction details provided in this callback function can be used for audit trail purposes. The engine continues retrying the transaction or action as usual.
To Register the Rule Function
To register the rule function, add the following property to the be-engine.tra / project CDD file at an appropriate level (for example, at the cluster level to affect all deployed engines). Set the value to the project path of the error handler rule function:
be.engine.txn.error.function=projectPathToErrorHandlerRuleFunction
Rule Function Signature
The required signature for the error handler rule function is:
int Name (Object txns, int errorType, int errCode, String errMsg, long retryCount)
The return value must be 0 (zero).
Arguments are explained in Transaction Error Handler Rule Function Reference.
- Transaction Error Handler Rule Function Reference
This table contains reference for the Transaction Error Handler rule function.