WebSphere MQ supports:
when used in conjunction with the Sybase XA-Server component Version 11.1.1 on the following platforms:
You need to do the following:
Within the Sybase XA configuration file, define a Logical Resource Manager (LRM) for each connection to the Sybase server that is being updated.
Refer to the Sybase publication, XA-Server Integration Guide for Tuxedo (Document ID 35002-01-1111-01), and to the Release Bulletin XA-Server Version 11.1.1 appropriate to your platform for information about configuring the Sybase server for XA support and modifying the Sybase XA configuration file, $SYBASE/xa_config.
An example of the contents of $SYBASE/xa_config is shown in Figure 19.
Figure 19. Example contents of $SYBASE/xa_config
# The first line must always be a comment [xa] LRM=lrmname server=servername xaserver=xaservername |
The easiest way to create the Sybase switch load file is to use the sample files supplied with WebSphere MQ.
The xa.h header file is in the same directory as sybswit.c.
The source for the switch load file can be found in:
As explained in "Creating the Oracle switch load file (UNIX systems)", the queue manager processes do not inherit the environment variables (LD_LIBRARY_PATH on Solaris and LIBPATH on AIX) from the shell in which the strmqm command was issued. To find the libraries when the queue manager starts up, specify a runtime linking path when the switch load file is built. The sample makefiles in the following sections operate in this way.
To create the Sybase switch load file on Windows systems, compile sybswit.c and link it with libxaserver.lib.
To create the DLL:
For Microsoft Visual C++:
Figure 20. Makefile for Sybase switch on Windows systems using Microsoft Visual C++
!include <ntwin32.mak> sybswit.lib sybswit.exp: $*.obj $*.def $(implib) -machine:$(CPU) \ -def:$*.def $*.obj sybswit.dll: $*.obj $*.def $*.exp $(link) $(dlllflags) \ -base:0x1C000000 \ $*.exp $*.obj \ $(conlibsdll) libxaserver.lib .c.obj: $(cc) $(cflags) $(cvarsdll) $*.c |
Figure 21. Makefile for Sybase switch on Windows systems using IBM VisualAge for C++
.\sybswit.obj: \ sybswit.c \ {$(INCLUDE);}xa.h @echo " Compile " icc.exe /Gm /Ti- /Gd /Ge- /Gf- /Fosybswit.obj /C sybswit.c .\sybswit.exp: \ .\sybswit.obj @echo " Make exp and lib files " ilib.exe /Gi:sybswit .\sybswit.obj .\sybswit.dll: \ .\sybswit.exp \ .\sybswit.obj \ {$(LIB)}libxaserver.lib @echo " Link " icc.exe @<< /B" /de /pmtype:vio /noe /code:RX /data:RW /dll" /B" /def" /B" /def:libxaserver" /B" /nod:sybswit.lib" /Fesybswit.dll libxaserver.lib .\sybswit.exp .\sybswit.obj |
WebSphere MQ provides a sample makefile, xaswit.mak, to build the switch files for a variety of database products. You can find xaswit.mak in the directory /usr/mqm/samp/xatm, with the source files you need to build the switch.
Edit xaswit.mak to uncomment the lines appropriate to the version of Sybase you are using. Then execute the makefile using the command:
make -f xaswit.mak sybswit
The generated switch file is placed in your current directory.
The next step is to modify the configuration information for the queue manager to define Sybase as a participant in global units of work. On Windows systems, use the Resources page of the properties for the queue manager (accessed from the WebSphere MQ Services snap-in). On UNIX systems, use the XAResourceManager stanza of the qm.ini configuration file.
-Uusername -Ppassword -Nconnection_name -Llogfile -Ttype
where:
In Figure 22, the MQBankDB database is associated with the lrmname LRM definition in the Sybase XA configuration file, $SYBASE/xa_config. Include a log file if you want XA function calls to be logged.
Figure 22. Sample XAResourceManager entry for Sybase on UNIX platforms
XAResourceManager: Name=Sybase MQBankDB SwitchFile=/usr/bin/sybswit XAOpenString=-Uuser -Ppassword -Nlrmname -L/tmp/sybase.log -Txa |