Transaction Error Handler Rule Function Reference

This table contains reference for the Transaction Error Handler rule function.

Argument Notes
Object txns You can turn this argument into an Object[] within the rule function, for example:
Object[] array = txns;

The resulting array can be used to obtain useful data:

  • array[0] is a Concept[] containing all the Concept objects that:
    • have been created in the current RTC,
    • and have not been deleted.
  • array[1] is a Concept[] containing all the Concept objects that:
    • existed before the current RTC,
    • have been modified in the current RTC,
    • and have not been deleted.
  • array[2] is a Long[] containing the id of all the Concept objects that:
    • existed before the current RTC,
    • and have been deleted in the current RTC.
  • array[3] is a SimpleEvent[] containing all the SimpleEvent objects that:
    • are going to be added to the cache.
  • array[4] is a Long[] containing the id of all the Event objects that:
    • existed before the current RTC, or arrived and started the RTC,
    • and have been deleted in the current RTC.
int errorType Value can be one of:

-1 for errors happening during database operations.

-2 for errors happening when sending an event.

int errCode The error code, which is dependent on errorType:
  • For database related errors:
    • The error code as returned by SQLException, if available
    • Else -100 if TIBCO BusinessEvents determines that the database is not available
    • Else -200, which means that this is an unknown error
  • For sent event errors, the value is -1, meaning an internal error condition.
String errMsg The associated exception message.
long retryCount The number of times this transaction has been retried before the present call to the callback.

Handling Post-RTC action errors:

When Post-RTC actions fail, such as acknowledging or sending a message, action handlers try only 10 times with 500 milliseconds sleep. The following parameter scan be configured:
  • be.engine.txn.action.retrycount, default is 10.
  • be.engine.txn.action.sleeptime, default is 500 milliseconds.

Handling Post-RTC database transaction errors:

In case of database exception, the number of tries and waits between each tries are handled by the following configuration parameters:

  • be.engine.txn.database.retrycount, default is maximum integer.
  • be.engine.txn.database.sleeptime, default is 5000 milliseconds.

After the number of tries are exhausted, the transaction is aborted.

You can also perform additional actions by registering an error handler rule function as before:

See be.txn.error function=projectPathToErrorHandlerRuleFunction.

Note: When the number of tries are exhausted and the transactions are aborted, it is likely that the cache and database will be in an inconsistent state. Practice care when setting a limit to the number of retries. Logs should be also monitored for database related exceptions and immediate action should take as soon as possible. It is also advised to disable parallel operations if a limit is set to the number of retries. In this case, multiple transactions are committed to the database together and a single database failure can affect multiple of them.