skip to main content
Interface Provider class : ipEndTransaction
 

ipEndTransaction

This method is called by the OpenAccess SDK SQL engine to end a transaction with a COMMIT, a ROLLBACK, or a PREPARE_TO_ COMMIT. This method will be called when a transaction is terminated by the user or by the server in response to errors. The necessary transaction and lock management code for your data source goes here.
This method must return DAM_SUCCESS even if the IP will not support transactions.
int ipEndTransaction(
    long dam_hdbc,
    int  iType)
Table 18. Parameters for ipEndTransaction
Parameter
Type
Description
INPUT
dam_hdbc
long
The connection handle.
iType
int
DAM_ROLLBACK - rollbackDAM_COMMIT - commitDAM_PREPARE_TO_COMMIT - commit for first phase of a two-phase operation.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure
You can return an IP-specific error code for a failed COMMIT operation by calling dam_addError to add an error with your application-specific error message and native code and then return DAM_FAILURE.
dam_addError(
    dam_hdbc,
    NULL,DAM_ERR_01000, 100, "My error message")
The previous line returns a native error code 100 and message "My error message" to the client application.