OpenAPI User Guide > OpenAPI User Guide > OpenAPI Function Reference > OpenAPI Functions > IIapi_rollback() Function--Roll Back a Transaction
Was this helpful?
IIapi_rollback() Function--Roll Back a Transaction
The IIapi_rollback() function rolls back a transaction started with IIapi_query() or IIapi_batch(), or restarted by IIapi_connect(). It also frees the transaction handle if the rb_savePointHandle parameter is NULL. If the rb_savePointHandle parameter is the savepoint handle returned by the IIapi_savePoint() function, the transaction is rolled back to the savepoint and the transaction handle remains valid.
Before rolling back a transaction, the application must call IIapi_close() to release all statement handles associated with the transaction.
This function has the following syntax:
II_VOID IIapi_rollback (IIAPI_ROLLBACKPARM *rollbackParm);
typedef struct _IIAPI_ROLLBACKPARM
{
       IIAPI_GENPARM   rb_genParm;
       II_PTR          rb_tranHandle;
       II_PTR          rb_savePointHandle;
} IIAPI_ROLLBACKPARM;
This function has the following parameters:
rb_genParm
Type: input and delayed output
Specifies the generic parameters. For a description, see Generic Parameters).
rb_tranHandle
Type: input
Specifies the transaction handle identifying the transaction to be rolled back. Its value is either from qy_tranHandle of IIapi_query(), ba_tranHandle of IIapi_batch(), or co_tranHandle parameter of IIapi_connect().
rb_savePointHandle
Type: input
Specifies an optional savepoint for the current rollback. This parameter contains a handle of the savepoint, returned by the IIapi_savePoint() function. If there is no savepoint for the current rollback, this parameter is NULL.
Last modified date: 08/14/2024