Share this page

# lrt_tx_open

Transaction Handling Functions

Opens a set of resource managers.

int lrt_tx_open( );

The lrt_tx_open function opens a set of resource managers. This is used in conjunction with lrt_tx_close.

## Return Values

If the function succeeds, it returns a non-negative value, TX_OK. If it fails, it returns a negative value.

## Parameterization

Parameterization is not applicable to this function.

## Example

In the following example, the lrt_tx_open function opens the resource managers.

Copy code

    TXINFO txinfo;
    lrt_tx_open();
    // open resource managers
    lrt_tx_set_transaction_timeout(30);
    // 30 second transaction timeout
    lrt_tx_begin();
    // start transaction
    lrt_tx_set_commit_return(TX_COMMIT_COMPLETED);
    // 2-phase commit
    lrt_tx_set_transaction_control(TX_UNCHAINED);
    // unchained transaction mode
    lrt_tx_commit();
    // commit transaction
    lrt_tx_begin();
    // start another transaction
    lrt_tx_info(&txinfo);
    lrt_tx_rollback();
    // abort it
    lrt_tx_close();
    // close resource managers

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: