Sybase configuration
Sybase support and configuration information.
- Ensure you have installed the Sybase XA libraries, for example by installing the XA DTM option.
- Check environment variable settings.
- Enable Sybase XA support.
- Create the Sybase switch load file.
- Add resource manager configuration information.
Checking the Sybase environment variable settings
- SYBASE
- The location of the Sybase product installation. For example, on UNIX and Linux® systems, use:
export SYBASE=/sybase
- SYBASE_OCS
- The directory under SYBASE where you have installed the Sybase client files.
Enabling Sybase XA support
# The first line must always be a comment
[xa]
LRM=lrmname
server=servername
Creating the Sybase switch load file
C:\Program Files\IBM\MQ\tools\c\samples\xatm
. To
create the Sybase switch load file with Microsoft Visual
C++, use:
nmake /f xaswit.mak sybswit.dll
The generated switch file is
placed in C:\Program Files\IBM\MQ\exits
. You can find xaswit.mak in the directory
. MQ_INSTALLATION_PATH
/samp/xatmMQ_INSTALLATION_PATH
represents the high-level directory in which
IBM MQ is installed.
make -f xaswit.mak sybswit
The generated 32-bit switch load file is placed in /var/mqm/exits.
The generated 64-bit switch load file is placed in /var/mqm/exits64.
SYBLINKFLAGS32=-brtl
# The following line is for Sybase 15
#SYBLINKFLAGS64=-brtl
# The following line is for Sybase 16
SYBLINKFLAGS64=-bstatic -bdynamic
The only change you need to make to the makefile is to ensure that only one of the SYBLINKFLAGS64 values is uncommented. The default is Sybase 16, which is the value to use for 15 #ESD5 and later.
Any XA switch file that is produced is linked to that specific release of Sybase and must not be moved to other platforms.
If the level of Sybase is changed, then the XA switch file should be rebuilt.
Adding resource manager configuration information for Sybase
- On Windows and Linux (x86 and x86-64 platforms) systems, use the IBM MQ Explorer. Specify the details of the switch load file in the queue manager properties panel, under XA resource manager.
- On all other systems specify the details of the switch load file in the XAResourceManager stanza in the queue manager's qm.ini file.
XAResourceManager:
Name=mysybase
SwitchFile=sybswit
XAOpenString=-Uuser -Ppassword -Nlrmname -L/tmp/sybase.log -Txa
ThreadOfControl=THREAD
Using multi-threaded programs with Sybase
If you are using multi-threaded programs with IBM MQ global units of work incorporating updates to Sybase, you must use the value THREAD for the ThreadOfControl parameter. Also ensure that you link your program (and the switch load file) with the threadsafe Sybase libraries (the _r versions). Using the value THREAD for the ThreadOfControl parameter is shown in the previous example.