ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Problems getting XA working with WMQ/WBIMB/Oracle

Post new topic  Reply to topic
 Problems getting XA working with WMQ/WBIMB/Oracle « View previous topic :: View next topic » 
Author Message
foo
PostPosted: Wed May 11, 2005 2:07 am    Post subject: Problems getting XA working with WMQ/WBIMB/Oracle Reply with quote

Newbie

Joined: 20 Jan 2005
Posts: 8

Hi,

I am trying to set up globally co-ordinated (XA) transactions between WBIMB and Oracle, using MQ as the transaction co-ordinator. All three applications reside on the same physical Solaris machine.

Having closely followed the instructions in the WBIMB and MQ manuals, I have arrived at the following qm.ini, .odbc.ini and tnsnames.ora files:

qm.ini:

Code:
#*******************************************************************#
#* Module Name: qm.ini                                             *#
#* Type       : WebSphere MQ queue manager configuration file      *#
#  Function   : Define the configuration of a single queue manager *#
#*                                                                 *#
#*******************************************************************#
#* Notes      :                                                    *#
#* 1) This file defines the configuration of the queue manager     *#
#*                                                                 *#
#*******************************************************************#
ExitPath:
   ExitsDefaultPath=/var/mqm/exits/
#*                                                                 *#
#*                                                                 *#
Log:
   LogPrimaryFiles=3
   LogSecondaryFiles=2
   LogFilePages=16384
   LogType=CIRCULAR
   LogBufferPages=0
   LogPath=/var/mqm/log/UKBRKR1D/
   LogWriteIntegrity=TripleWrite
Service:
   Name=AuthorizationService
   EntryPoints=10
ServiceComponent:
   Service=AuthorizationService
   Name=MQSeries.UNIX.auth.service
   Module=/opt/mqm/lib/amqzfu
   ComponentDataSize=0
XAResourceManager:
   Name=ODRDEV
   SwitchFile=/opt/wmqi/merant/lib/UKor8dtc18.so
   XAOpenString=ORACLE_XA+SQLNET=ODRDEV+SesTm=35+ACC=P/wmbiuser/password+Threads=true+LogDir=/var/mqm/xa_trace
   XACloseString=
   ThreadOfControl=THREAD
XAResourceManager:
   Name=WDEVBRKR
   SwitchFile=/opt/wmqi/merant/lib/UKor8dtc18.so
   XAOpenString=ORACLE_XA+SQLNET=WDEVBRKR+SesTm=35+ACC=P/wmbi6200/password+Threads=true+LogDir=/var/mqm/xa_trace
   XACloseString=
   ThreadOfControl=THREAD


odbc.ini:

Code:
[ODBC Data Sources]
WDEVBRKR=DataDirect 410 Oracle 8 Driver
ODRDEV=DataDirect 410 Oracle 8 Driver
ODR=DataDirect 410 Oracle 8 Driver
FUM=DataDirect 410 Oracle 8 Driver

[WDEVBRKR]
Driver=/opt/wmqi/merant/lib/UKor818.so
WorkArounds=536870912
WorkArounds2=2
Description=Oracle9
ServerName=WDEVBRKR
EnableDescribeParam=1
OptimizePrepare=1

[ODRDEV]
Driver=/opt/wmqi/merant/lib/UKor818.so
WorkArounds=536870912
WorkArounds2=2
Description=Oracle9
ServerName=ODRDEV
EnableDescribeParam=1
OptimizePrepare=1

[ODBC]
Trace=1
TraceFile=/var/wmqi/odbc/odbctrace.out
TraceDll=/opt/wmqi/merant/lib/odbctrac.so
InstallDir=/opt/wmqi/merant


tnsnames.ora:

Code:
# TNSNAMES.ORA Network Configuration File: /u01/app/oracle/product/9.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ODRDEV =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = DHDBDEV)(PORT = 1524))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ODRDEV)
    )
  )

WDEVBRKR =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = BKDBDEV)(PORT = 1523))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = WDEVBRKR)
    )
  )


With this configuration, I see the following AMQERR01.LOG entries at Queue Manager startup:

Code:
----- amqztmb0.c : 213 --------------------------------------------------------
05/10/05  05:22:26 PM
AMQ7605: The XA resource manager ODRDEV has returned an unexpected return code
-5, when called for xa_open.

EXPLANATION:
WebSphere MQ received an unexpected return code when calling XA resource
manager ODRDEV at its xa_open entry point.  This indicates an internal error,
either within MQ or the resource manager.
ACTION:
Try to determine the source of the error.  A trace of the failure could be used
to look at the XA flows between MQ and the resource manager. MQ has allocated
an RMId of 2 to this resource manager.  This will be useful when isolating the
flows associated with the resource manager concerned. If the error occurs on an
xa_commit or xa_rollback request, the queue manager will not attempt to
redeliver the commit or rollback instruction for this transaction, until after
the queue manager has been restarted. The transaction indoubt is identified by
the following XID of X'000000000000000000000000'. If you think that the error
lies within the queue manager, contact your IBM support center.  Do not discard
any information describing the problem until after the problem has been
resolved.


Interestingly, MQ always receives the unexpected return code from which ever XA Resource Manager is configured in the second of the two XAResourceManager stanzas. i.e., if I switch the two XAResourceManager stanzas around, the AMQERR01.LOG 'EXPLANATION' entry becomes:

Code:
EXPLANATION:
WebSphere MQ received an unexpected return code when calling XA resource
manager WDEVBRKR at its xa_open entry point.  This indicates an internal error,
either within MQ or the resource manager.
ACTION:
Try to determine the source of the error.  A trace of the failure could be used
to look at the XA flows between MQ and the resource manager. MQ has allocated
an RMId of 2 to this resource manager.  This will be useful when isolating the
flows associated with the resource manager concerned. If the error occurs on an
xa_commit or xa_rollback request, the queue manager will not attempt to
redeliver the commit or rollback instruction for this transaction, until after
the queue manager has been restarted. The transaction indoubt is identified by
the following XID of X'000000000000000000000000'. If you think that the error
lies within the queue manager, contact your IBM support center.  Do not discard
any information describing the problem until after the problem has been
resolved. 


I also get the following error from the xa_trace:

Code:

xaopopni: XAER_INVAL; DB name not unique.



If I omit the WDEVBRKR stanza, the Queue Manager starts cleanly, but, after starting the broker, I get the following error in the ODBC trace output:

Code:
[      90] "[DataDirect][ODBC Oracle driver]No Oracle environment handle returned from Oracle clients."



and the following error in the WBIMB trace:

Code:
[DataDirect][ODBC Oracle driver]No Oracle environment handle returned from Oracle clients.
[DataDirect][ODBC Oracle driver]There is already a connection enlisted in a distributed transaction on this thread through this DataSource.


If I change the XA configuration in the qm.ini to ThreadOfControl=PROCESS (and remove Threads=true), the Queue Manager wont start - it just hangs and logs nothing.


Can anybody help!?


Versions:

Solaris: 5.9
Oracle: 9.2.0.4 (XA Version 9.2.0.1.0)
WBIMB: 5.0 CSD05
WMQ: 5.3 CSD09



Last edited by foo on Fri May 13, 2005 5:38 am; edited 1 time in total
Back to top
View user's profile Send private message
foo
PostPosted: Fri May 13, 2005 5:19 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2005
Posts: 8

Update:

After adding a 'DB' parameter to each XAOpenString in the qm.ini, the Queue Manager now starts cleanly with no errors. This is because the 'DB' parameter becomes mandatory when more than one database is being accessed in a single Oracle installation (it's optional otherwise).

When starting the Broker, the XA errors seen in the QM logs have now changed to '-3' and '-6'; i.e.:

Code:
----- amqztmb0.c : 478 --------------------------------------------------------
05/12/05  09:15:26 AM
AMQ7605: The XA resource manager ODRDEV has returned an unexpected return code
-6, when called for xa_start.

EXPLANATION:
WebSphere MQ received an unexpected return code when calling XA resource
manager ODRDEV at its xa_start entry point.  This indicates an internal error,
either within MQ or the resource manager.
ACTION:
Try to determine the source of the error.  A trace of the failure could be used
to look at the XA flows between MQ and the resource manager. MQ has allocated
an RMId of 1 to this resource manager.  This will be useful when isolating the
flows associated with the resource manager concerned. If the error occurs on an
xa_commit or xa_rollback request, the queue manager will not attempt to
redeliver the commit or rollback instruction for this transaction, until after
the queue manager has been restarted. The transaction indoubt is identified by
the following XID of
X'004D514D000000100000000442822D652000FA01554B42524B52314400000001'. If you
think that the error lies within the queue manager, contact your IBM support
center.  Do not discard any information describing the problem until after the
problem has been resolved.

----- amqztmb0.c : 478 --------------------------------------------------------
05/12/05  09:15:26 AM
AMQ7605: The XA resource manager WDEVBRKR has returned an unexpected return
code -3, when called for xa_start.

EXPLANATION:
WebSphere MQ received an unexpected return code when calling XA resource
manager WDEVBRKR at its xa_start entry point.  This indicates an internal
error, either within MQ or the resource manager.
ACTION:
Try to determine the source of the error.  A trace of the failure could be used
to look at the XA flows between MQ and the resource manager. MQ has allocated
an RMId of 2 to this resource manager.  This will be useful when isolating the
flows associated with the resource manager concerned. If the error occurs on an
xa_commit or xa_rollback request, the queue manager will not attempt to
redeliver the commit or rollback instruction for this transaction, until after
the queue manager has been restarted. The transaction indoubt is identified by
the following XID of
X'004D514D000000100000000442822D652000FC01554B42524B52314400000001'. If you
think that the error lies within the queue manager, contact your IBM support
center.  Do not discard any information describing the problem until after the
problem has been resolved.


The [DataDirect] errors continue to occur, and the following errors in the Broker logs also appear:

2122 (MQRC_PARTICIPANT_NOT_AVAILABLE)
2195 (MQRC_UNEXPECTED_ERROR)
2009 (MQRC_CONNECTION_BROKEN)

Also, setting ThreadOfControl=PROCESS in the qm.ini now no longer causes the Queue Manager to hang: it now starts cleanly.

The Broker errors, however, remain very similar.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri May 13, 2005 6:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is Oracle up and running when you start the QM? (I know, stupid question, but needs to be asked.)

Is Oracle logging anything when the QM is throwing these errors?

Do the broker service user and the mqm user have sufficient priviledges to access the Oracle binaries and etc.? Have you configured the broker service user and the mqm user to have the necessary oracle environment setup?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ian
PostPosted: Wed May 18, 2005 7:11 am    Post subject: Reply with quote

Disciple

Joined: 22 Nov 2002
Posts: 152
Location: London, UK

You need to ensure you have covered the points raised by jefflowrey.

Your configuration looks correct (from what I can see).
Yes, you need to have DB specified on the XAOpenString if you have 2 or more databases are defined as XA resources.
Yes, you must have Threads=true set on the XAOpenString AND ThreadOfControl=THREAD set.
WBIMB is a threaded application and the TM, RM and AP must all run in the same mode of threaded.

For example :

Code:

XAResourceManager:
   Name=ODRDEV
   SwitchFile=/opt/wmqi/merant/lib/UKor8dtc18.so
   XAOpenString=ORACLE_XA+SQLNET=ODRDEV+SesTm=35+ACC=P/wmbiuser/password+Threads=true+LogDir=/var/mqm/xa_trace+DB=ODRDEV
   XACloseString=
   ThreadOfControl=THREAD


Have you stopped and restarted your queue manager, database server and broker after changing these various settings ?

Have you setup both userid's, wmbiuser & wmbi6200, as per the mqsicreatebroker mqsisetdbparms commands ?

Have you granted the correct access to both usreid's, wmbiuser & wmbi6200, as per below ?

Quote:

Ensure that the user ID that is used to access the database and specified in the XAOpenString has the necessary Oracle privileges to access the DBA_PENDING_TRANSACTIONS view. You can grant the required access using the following Oracle SQLPLUS command:
grant select on DBA_PENDING_TRANSACTIONS to <userid>;


FYI, you only require the broker database to be defined as an XA resource if ...

Quote:

If your message flows reference message dictionaries, or contain Publication nodes, you must also define an XAResourceManager stanza for the broker internal database using the same method.


If you still can not get this working then you may need to open a problem report with IBM so that we can have a further look into this.
_________________
Regards, Ian
Back to top
View user's profile Send private message
foo
PostPosted: Thu May 19, 2005 7:01 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2005
Posts: 8

First of all, thanks for your responses guys.

Here is the state of play. Most of the above suggestions had already been tried, but for the sake of clarity, here is a recap:

Oracle, QM and MB have been restarted after making changes

Oracle is up and running when QM started

mqm and broker service user (also wbim6200) are configured for an oracle environment

wmbiuser and wbim6200 have been set up as per the mqsicreatebroker mqsisetdbparms commands

DBA_PENDING_TRANSACTIONS has been granted to both users

Broker is using 'message dictionaries', so (according to docs) we need two QM XA stanzas

mqm and broker service user have access to oracle binaries and the switch file. Would it possible to expand on 'and etc.' please?

Not exactly sure what is meant by 'mode of threaded' for Oracle (would it be possible to expand on this please?), but can confirm that all known Oracle parameters of this nature have now been set to reflect multithreading... and here lies the one piece of positive news: since changing some Oracle parameters, it appears that the queue manager has stopped throwing AMQ7605s and and that there are no further .trc dumps in /var/mqm/xa_trace (location as specified in the XAOpenString). We will now examine the latest Oracle logs.

We are, however, still seeing the same two [DataDirect] errors reported above.

This has already been raised as a PMR and we are in the process of gathering logs now.

The relevant errors have also been posted on both the Oracle and DataDirect forums. We await responses.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu May 19, 2005 7:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

foo wrote:
mqm and broker service user have access to oracle binaries and the switch file. Would it possible to expand on 'and etc.' please?


Not really... I don't know Oracle.

But if you can, as the broker service user and mqm user, establish a connection manually... then there are not security issues relating to file permissions, nor other various kinds of issues.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
foo
PostPosted: Thu May 19, 2005 7:57 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2005
Posts: 8

As Oracle uses its own authentication engine (as opposed to the OS one), we have tested logging in to Oracle (using a tool called SQL+) as wmbiuser and as wbim6200. Both were successful. This effectively also tests tnsnames.ora.

Also been assured by our DBA that all oracle libs are publicly readable to 'everyone'. Are there any other file system permission gotchas that anyone is aware of?

Ta.
Back to top
View user's profile Send private message
JT
PostPosted: Thu May 19, 2005 8:43 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Which 9.2 client library (32 or 64-bit) did you reference when creating the symbolic link. Should have been the 32-bit client library:

Code:
ln -s <ORACLE_INSTALL_DIR>/lib32/libclntsh.so /usr/lib/libclntsh.a
Back to top
View user's profile Send private message
foo
PostPosted: Thu May 26, 2005 2:47 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2005
Posts: 8

We now appear to have this working and are currently testing. It seems that our problem was related to ODBC DSNs.

When using WBIMB in non-XA mode, any ODBC DSN being used does not have to match the ServerName entry inside that DSN's definition (i.e. each DSN is an alias of its associated ServerName). However, when in XA mode, it seems that each DSN must be the same as its corresponding ServerName (which effectively means that the DSN is no longer an alias). Each DSN must also match the corresponding QM XAResourceManager DB/SQLNET name and Broker DSN.

We're now looking into using tnsnames.ora to provide aliasing instead.
Back to top
View user's profile Send private message
JLRowe
PostPosted: Thu May 26, 2005 3:04 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

Glad it works and you've found a reason why it now works.

Keep taking the pills, you'll recover from the trauma eventually!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Problems getting XA working with WMQ/WBIMB/Oracle
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.