Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

OAIP_endTransaction

  • Last Updated: May 12, 2026
  • 1 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

This function is called by the OpenAccess SDK SQL engine to end a transaction with a COMMIT, a ROLLBACK or a PREPARE_TO_COMMIT. This function is 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 function must return DAM_SUCCESS even if the IP does not support transactions.

int OAIP_endTransaction(
    DAM_HDBC dam_hdbc, 
    IP_HDBC  hdbc, 
    int      iType)

Parameters for OAIP_endTransaction

Parameter Type Description
IN
dam_hdbc DAM_HDBC The connection handle.
hdbc IP_HDBC A pointer to the connection information maintained by the IP.
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 or dam_addErrorW to add an error with your application specific error message and native code and then returning 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.

See also

TitleResults for “How to create a CRG?”Also Available inAlert