lrt_tx_info

Transaction Handling Functions

Returns global transaction information.

int lrt_tx_info ( TXINFO *info );

info Global transaction information.

The lrt_tx_info function returns global transaction information.

Return Values

If the caller is in transaction mode, the function returns 1. If the caller is not in transaction mode, the function returns 0. If the function fails, it returns a negative value.

Parameterization

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

Example

In the following example, the lrt_tx_info function returns global information to the txinfo variable.

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