Back to home page

Enduro/X

 
 

    


0001 TPOPEN(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpopen - Open XA sub-system, connect to XA resource manager
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int tpopen (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 you want to delay this till actual *tpopen()*, 
0037 then you may set *NDRX_XA_LAZY_INIT* 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 *tpopen()* was already call and XA is initialized, then function will succeed,
0043  and no error will be generated.
0044 
0045 RETURN VALUE
0046 ------------
0047 On success, *tpopen()* return zero; on error, -1 is returned, with 
0048 *tperrno* set to indicate the error.
0049 
0050 
0051 ERRORS
0052 ------
0053 Note that *tpstrerror()* returns generic error message plus custom message 
0054 with debug info from last function call.
0055 
0056 *TPERMERR* Resource Manager failed. The *tpstrerror()* will provide more 
0057 info from last call.
0058 
0059 *TPESYSTEM* System failure occurred during serving. See logs i.e. 
0060 user log, or debugs for more info. This could also be a 
0061 problem with dynamical driver loading.
0062 
0063 *TPEOS* System failure occurred during serving. See logs i.e. user log, 
0064 or debugs for more info.
0065 
0066 EXAMPLE
0067 -------
0068 See *atmitest/test021_xafull/atmiclt21.c* for sample code.
0069 
0070 BUGS
0071 ----
0072 Report bugs to support@mavimax.com
0073 
0074 SEE ALSO
0075 --------
0076 *tpcommit(3)* *tpopen(3)* *tpclose(3)* *tpsuspend(3)* *tpresume(3)*
0077 
0078 COPYING
0079 -------
0080 (C) Mavimax, Ltd
0081