skip to main content
Interface Provider class : IP methods reference : 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(
int64 dam_hdbc,
int iType)
 
Table 6: Parameters for ipEndTransaction 
Parameter
Type
Description
IN
 
 
dam_hdbc
int64
The connection handle
iType
int
DAM_ROLLBACK – rollback
DAM_COMMIT – commit
DAM_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 returning DAM_FAILURE.
dam_addError(
dam_hdbc,
null ,DAM_IP_ERROR, 100, "My error message")
The previous line returns a native error code 100 and the message "My error message" to the client application.

See also 

dam_addError