Share this page

# lrt_tpcommit

Transaction Handling Functions

Commits the current transaction.

int lrt_tpcommit( long flags );

flags | Reserved for future use. Must be set to 0.

The lrt_tpcommit function commits the current System/T transaction.

A transaction in System/T is a logical unit of work that either completely succeeds or has no effect. Transactions allow work being performed by many processes, possibly at different sites, to be treated as a single work unit. The initiator of the transaction can end the transaction using either lrt_tpabort or lrt_tpcommit. lrt_tpcommit can only be called by the initiator of the transaction. If any of the participants cannot commit their portion of the transaction, then lrt_tpcommit fails.

## Return Values

If the function ends with an error, it returns -1 and sets the error code in tperrno.

## Parameterization

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

## Example

In the following example, the lrt_tpcommit statement commits the transaction if there was no error.

Copy code

    /* Begin a new transaction. Commit if no error*/
    tpresult_int = lrt_tpbegin(30, 0);
    .
    .
    lrt_abort_on_error();
    lrt_tpcommit(0);

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: