Back to home page

Enduro/X

 
 

    


0001 TX_OPEN(3)
0002 ==========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tx_open - Open XA sub-system, connect from XA resource manager
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <tx.h>
0014 
0015 int tx_open(void);
0016 
0017 For XATMI client link with '-latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm'
0018 
0019 For XATMI server link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0020 
0021 DESCRIPTION
0022 -----------
0023 Connect to the XA resource manager. Note that environment for process must be 
0024 configured, so that Enduro/X can load correct resource manager drivers. 
0025 See the *ex_env(5)* man page for environment variables, that must be set. 
0026 Basically Enduro/X will dynamically load library set in *NDRX_XA_DRIVERLIB* env 
0027 variable. This is the driver which provides in unified way of getting *xa_switch*. 
0028 As the xa_switches can be located in different Resource Managers, the second 
0029 library might be need to load and that is marked in *NDRX_XA_RMLIB* env variable. 
0030 The resource manager ID is set in *NDRX_XA_RES_ID* env variable. If your 
0031 application needs different resource managers or different transaction branches, 
0032 then you can use environment variable override functionality, see *ex_envover(5)* 
0033 and *ndrxconfig.xml(5)*. XA connection strings for Enduro/X drivers are stored 
0034 into *NDRX_XA_OPEN_STR* and *NDRX_XA_CLOSE_STR* variables. Enduro/X will try 
0035 to init XA sub-system  as soon as possible (i.e. load drivers, etc.). 
0036 If to delay initial XA drivers loading till actual *tx_open(3)* call, 
0037 then environment variable *NDRX_XA_LAZY_INIT* should be set to 1. 
0038 
0039 This function at lowest level, basically calls XA switches *xa_open_entry()* 
0040 function with *NDRX_XA_OPEN_STR* string.
0041 
0042 If *tx_open(3)* was already called and XA is initialized, then function will succeed,
0043  and no error will be generated.
0044 
0045 TX API is base on TP API. This function is based on *tpclose(3)* and it is possible
0046 to mix these two API kinds.
0047 
0048 
0049 RETURN VALUE
0050 ------------
0051 On success, *tx_close()* return *TX_OK*; on error, error code is returned
0052 
0053 ERRORS
0054 ------
0055 
0056 *TX_FAIL* Failed to open XA resource (cannot load Enduro/X XA driver, cannot
0057 load resource manager driver or resource manager returned
0058 
0059 EXAMPLE
0060 -------
0061 See *atmitest/test021_xafull/atmiclt21tx.c* for sample code.
0062 
0063 BUGS
0064 ----
0065 Report bugs to support@mavimax.com
0066 
0067 SEE ALSO
0068 --------
0069 *tx_close(3)* *tpopen(3)* *tx_open(3)* *tx_commit(3)* *tx_rollback(3)* *tx_info(3)*
0070 
0071 COPYING
0072 -------
0073 (C) Mavimax, Ltd
0074