![]() | ![]() |
Home |
|
|
XA Interface Integration Guide for CICS, Encina, and TUXEDO Adaptive Server Version 12.5 |
|
| Chapter 3 Configuring the XA Environment |
|
| Using the DTM XA Interface with CICS |
This section explains how to setup your CICS environment to use the DTM XA Interface. See also "XA configuration file for DTM XA Interface" for information on creating an XA configuration file.
Each RM defined in the CICS environment must provide an XA switch-load file. The switch-load file is a component of your CICS configuration; it is referenced in the XAD. It contains the RM's name, a flag, a version number and a set of non-null pointers to the RM's entry points, provided by the DTM XA Interface.
All of the Sybase XADs share a single switch-load file. You can build your Sybase switch-load file using the file sybasexa.c, which is located in:
$SYBASE/$SYBASE_OCS/sample/xa-dtm/cics/switch
The following is a listing of sybasexa.c:
/*
**
** sybasexa.c
**
** The sybasexa routine references the Sybase xa
** switch structure named "sybase_TXS_xa_switch".
** The switch structure is part of the
** XA product library "libdtmxa.a".
**
** See your CICS documentation for details on the
** switch-load file.
*/
#include <stdio.h>
#include <tmxa/xa.h>
extern struct xa_switch_t sybase_TXS_xa_switch;
extern struct xa_switch_t RegXA_xa_switch;
extern struct xa_switch_t *cics_xa_switch;
struct xa_switch_t *sybasexa(void)
{
cics_xa_switch = &sybase_TXS_xa_switch;
cics_xa_init();
return(&RegXA_xa_switch);
}This source code references the Sybase XA switch structure, which is global to the DTM XA Interface and defined as follows:
struct xa_switch_t sybase_TXS_xa_switch =
{
"SYBASE_SQL_SERVER",
TMNOFLAGS,
0,
xa_open,
xa_close,
xa_start,
xa_end,
xa_rollback,
xa_prepare,
xa_commit,
xa_recover,
xa_forget,
xa_complete
};The use of TMNOFLAGS specifies that the DTM XA Interface supports thread migration but does not support dynamic registration or asynchronous operations. For a description of these features, see the X/Open CAE Specification (December 1991) Distributed Transaction Processing: The XA Specification.
Compiling the switch-load file on IBM RISC System/6000 AIXCompile sybasexa.c using the makefile sybasexa.mk, which is located in $SYBASE/$SYBASE_OCS/sample/xa-dtm/cics/switch.
This is a listing of sybasexa.mk. Edit it to reflect your configuration.
SYB_LIBDIR = $(SYBASE)/$(SYBASE_OCS)/lib
SYBLIBS = -lxadtm -lct_r.so -lcs_r.so -ltcl_r.so -lcomn_r.so -lintl_r
-lxdsxom
all : sybasexa.c xlc_r4 -bnoquiet -v -D_THREAD_SAFE \
-I/usr/lpp/encina/include sybasexa.c \
-o sybasexa \
-esybasexa \
-L/usr/lpp/cics/lib \
-L$(SYB_LIBDIR) \
$(SYBLIBS) \
-lcicsrt -ldce -lm \
/usr/lpp/cics/lib/regxa_swxa.oYou must use the shareable versions of CS-Library (libcs_r.so.) and Common Library (libcom_r.so.).
Compiling the switch-load file on HP9000 Series 800 HP-UXCompile sybasexa.c using the makefile sybasexa.mk.hp800, which is located in$SYBASE/$SYBASE_OCS/sample/xa-dtm/cics/switch
This is a listing of sybasexa.mk.hp800. Edit it to reflect your configuration.
#
# Makefile to compile the LoadSwitchTable
# This makefile should be run with the command
# "make -f sybasexa.mk.hp800"
#
CC=/opt/ansic/bin/cc
CCOPTS= -Aa +z -Dsybasexa=CICS_XA_Init
ENCINA=/opt/encina
CICS=/opt/cics
LD=/usr/ccs/bin/ld
SYB_LIBDIR = $(SYBASE)/$(SYBASE_OCS)/lib
CICS_LIBDIR = $(CICS)/lib
all: sybasexa
sybasexa: sybasexa.o
$(LD) -b \
+e CICS_XA_Init \
-o sybasexa \
sybasexa.o \
$(CICS_LIBDIR)/regxa_swxa.o \
-Bimmediate -Bnonfatal +s +b/opt/cics/lib \
$(SYB_LIBDIR)/libxadtm.a \
$(SYB_LIBDIR)/libct_r.a \
$(SYB_LIBDIR)/libcs_r.sl \
$(SYB_LIBDIR)/libtcl_v.a \
$(SYB_LIBDIR)/libcomn_v.sl \
$(SYB_LIBDIR)/libintl_r.sl \
-lm \
$(CICS_LIBDIR)/libcicsrt.sl \
-lc
sybasexa.o: sybasexa.c
$(CC) -c $(CCOPTS)\
-I$(ENCINA)/include sybasexa.cYou must use the shareable versions of CS-Library (libcs_r.sl) and Common Library (libcomn_dce.sl).
You must have the ANSI C compiler to build the Load Switch Table.
Compiling the switch-load file on Sun Solaris 2.x (SPARC)Compile sybasexa.c using the makefile sybasexa_sol.mk which is located in $SYBASE/$SYBASE_OCS/sample_dtm/cics/switch.
This is a listing of sybasexa_sol.mk. Edit it to reflect your configuration.
#Makefile to compile the LoadSwitchTable #This makefile should be run with the command "make -f sybasexa_sol.mk" SYB_LIBDIR = $(SYBASE)/lib SYBLIBS = lxadtm -lct_r -lcs_r.so -ltcl_r -lcomn_r.so -lintl_r -lxdsxom -lm all: sybasexa.c /bin/xlc_r -v -D_THREAD_SAFE \ -I /usr/lpp/encina/include sybasexa.c \ -o sybasexa \ -esybasexa \ -L/usr/lpp/cics/lib \ -L$(SYBLIBS) \ -lcicsrt \ /usr/lpp/cics/lib/regxa_swxa.o -ldce
The CICS TM uses CICS XAD information to communicate with other RMs. The XAD definition contains one Sybase stanza for each LRM. For a description of an XAD stanza's attributes, see your CICS documentation.
Below are two sample Sybase XAD stanzas. Use the SMIT utility to add stanzas to your CICS region.
betaOne:
GroupName=""
ActivateOnStartup=yes
ResourceDescription="XA Product Definition"
AmendCounter=2
Permanent=no
SwitchLoadFile="/usr/lpp/sybase/sample/xa_library/
cics/switch/sybasexa"
XAOpen="-Uuser_1 -Ppassword_1 -Nconnection_1"
XAClose="ignored"
XASerialize=all_operations
betaTwo:
GroupName=""
ActivateOnStartup=yes
ResourceDescription="XA Product Definition"
AmendCounter=2
Permanent=no
SwitchLoadFile="/usr/lpp/sybase/sample/xa_library/
cics/switch/sybasexa"
XAOpen="-Uuser_2 -Ppassword_2 -Nconnection_2"
XAClose="ignored"
XASerialize=all_operationsThe following fields are configuration-dependent and must be modified:
SwitchLoadFile
XAOpen
XAClose
XASerialize
All Sybase stanzas can use the same switch-load file.
See "Open string parameters for DTM XA Interface" for information about the contents specified in the XAOpen string of the XAD Definition.
|
|