Using the adbPreCommit Function

The adbPreCommit function is used to perform a custom operation, such as invoking a stored procedure or sending a TIBCO Rendezvous message, just before a transaction is committed. This function is called by the subscriber after all insert, update, and delete operations have been performed on both parent and child tables.

The function signature is as follows:
public static int adbPreCommit(Connection connect handle,
                     MInstance data,
                     MApp pMapp, int messageFormat)
Note: If the return value is not zero, then the message will be rolled back.

The following table contains parameter descriptions and a column for each format.

Parameter TIBCO Rendezvous Format TIBCO ActiveEnterprise Format Description
connectHandle X X The database connection handle.
pMapp X X TIBCO Adapter SDK MApp structure for this MInstance.
messageFormat X X Format of a message.
The valid values are:
  • M_AERV_MESSAGE_FORMAT
  • M_XMLJMS_MESSAGE_FORMAT
  • M_XMLRV_MESSAGE_FORMAT

For details about these values, see TIBCO Adapter SDK Programmer's Guide.

Note: If an adapter is configured to use the adb.subBatchCommitTimeout or adb.subBatchCommitSize properties, the custom operation is performed once for each received message. However, the entire transaction is not committed until the size or timeout values are reached. Adapter configurations that use the bulk-insert-size option does not support the adbPreCommit function.

For more information about these properties, see "TIBCO ActiveMatrix Adapter for Database Properties" in Adapter Properties.