Share this page

# lrd_commit

Commits the current transaction.

    LRDRET lrd_commit( LRD_CONTEXT *mptContext, LRD_CONNECTION *mptConnection, int miDBErrorSeverity);

mptContext | A pointer to an LRD_CONTEXT structure. (ODBC and CtLib only), or zero (0).
mptConnection | A pointer to an LRD_CONNECTION structure, or zero (0).
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_commit function commits the current database transaction. Once you commit a transaction, you cannot perform a rollback.

To perform a COMMIT with a special option such as TO SAVEPOINT or FORCE, you must issue an SQL statement and execute it using lrd_stmt and lrd_exec.

One or the other of mptContext or mptConnection must be a null pointer. The other must be a pointer to a valid structure.

mptContext must be zero if neither ODBC nor CtLib is used.

For more details refer to the Function Header File lrd.h in the include directory.

## Return Values

See LRD Return Values.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, lrd_commit commits the transaction in the vuser_end section of the script, after completing all database activities.

Copy code

    int LR_FUNC vuser_end() {
        lr_think_time(11);
        lrd_commit( 0,Con1, 0 );
        lrd_close_connection(&Con1, 0, 0);
        lrd_end(0);
        return VUSER_OK;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: