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 » IBM MQ Java / JMS » MQ with DB2 type 4 driver

Post new topic  Reply to topic
 MQ with DB2 type 4 driver « View previous topic :: View next topic » 
Author Message
JYama
PostPosted: Mon May 15, 2006 4:27 am    Post subject: MQ with DB2 type 4 driver Reply with quote

Master

Joined: 27 Mar 2002
Posts: 281

Hi experts,

I'm writing a program in MQ Base Java on AIX v5.3 to execute a global transaction (two phase commit) between DB2 and a queue manager.

Now I'm suffering from an error which indicates "MQJE001: completion code 0, reason 2121".
I know this '2121' is very common error code, but since there are few information about MQ base java with JDBC type 4 driver, I can't understand its configuration clearly (For example, how can I configure XAOpenString in qm.ini and how can I access to the DB2 server.)

Is there anybody who is familiar with this problem?

I'm using DB2 v8.1.5 and WMQ v6.0.1, BTW.

Many Thanks in adavance.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 15, 2006 5:37 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Do you mean to say you are using the jdbc driver outside of a J2EE container ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
JYama
PostPosted: Mon May 15, 2006 5:53 pm    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 281

Quote:
Do you mean to say you are using the jdbc driver outside of a J2EE container ?

Yes, I do.
Because JDBC type 4 driver doesn't require DB2 client, I'm trying it outside of a J2EE container.
Are there any limitations?

* My MQ is running on AIX v5.3 and DB2 server is running on Win2K.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 15, 2006 6:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Yes,
For a multiphase commit your MQ connection MUST be a server connection.
Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
JYama
PostPosted: Mon May 15, 2006 6:26 pm    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 281

Quote:
For a multiphase commit your MQ connection MUST be a server connection.


Can I understand it that I have to use MQ server conneciton, not MQ client connection?
If so, there should be no problem because I'm using MQ server connection. My program directly connects to the QMgr within AIX.

Actually my java program and QMgr plus the JDBC driver are running on AIX and this program connects to the external database on Win2K.
Back to top
View user's profile Send private message
mvic
PostPosted: Tue May 16, 2006 12:57 am    Post subject: Re: MQ with DB2 type 4 driver Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

JYama wrote:
reason 2121

If I look up 2121, it is MQRC_NO_EXTERNAL_PARTICIPANTS. This reason code is given by the queue manager if you call MQBEGIN (or its Java equivalent) but there are no XAResourceManager stanzas in the qm.ini file.

See the following links for more information. (The first is specific to Java, but the second is not).
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/jtajdbc.htm
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.amqzag.doc/tsscen1.htm
Back to top
View user's profile Send private message
JYama
PostPosted: Tue May 16, 2006 11:59 pm    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 281

Thank you very much for lots of information.
However, the error still remains...
Code:
   public static void init() throws Exception{
      Hashtable properties = new Hashtable();

      properties.put(MQC.THREAD_AFFINITY_PROPERTY, new Boolean(true));
      properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);

      qMgr = new MQQueueManager(qmgrName,properties);
   
      com.ibm.db2.jcc.DB2XADataSource xadata = new com.ibm.db2.jcc.DB2XADataSource();

      xadata.setDatabaseName(dbName);
      xadata.setUser(dbUser);
      xadata.setPassword(dbPass);
      jdbcConn = qMgr.getJDBCConnection(xadata);
      jdbcConn.setAutoCommit(false);
      
   }


After the initialization above, I issue mq.begin like this;
Code:
         qMgr.begin();
   

Then, this call always fails with reason code 2121..
My qm.ini is;
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/
   ExitsDefaultPath64=/var/mqm/exits64/
#*                                                                 *#
#*                                                                 *#
Log:
   LogPrimaryFiles=3
   LogSecondaryFiles=2
   LogFilePages=128
   LogType=CIRCULAR
   LogBufferPages=0
   LogPath=/var/mqm/log/TESTSC/
   LogWriteIntegrity=TripleWrite
Service:
   Name=AuthorizationService
   EntryPoints=13
ServiceComponent:
   Service=AuthorizationService
   Name=MQSeries.UNIX.auth.service
   Module=/usr/mqm/lib64/amqzfu
   ComponentDataSize=0
XAResourceManager:
   Name=DB2XA
   SwitchFile=jdbcdb2
   XAOpenString=LIVDBPD
   ThreadOfControl=THREAD


I have completly no idea about the problem...
BTW, the DB2 instance I'm trying to connect is 64 bit.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed May 17, 2006 10:29 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Maybe this article will help. http://www.ibm.com/developerworks/websphere/library/techarticles/0601_ritchie/0601_ritchie.html

Additionally, from the above article and also previous experience, I would recommend adding TOC=P to the xa_open string (this is correct only for DB2, by the way), and changing to ThreadOfControl=PROCESS
Back to top
View user's profile Send private message
JYama
PostPosted: Mon May 22, 2006 5:04 am    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 281

Thank you very much a lot of information,all!

Does MQ V6 really support JDBC driver type 4?
Is there anybody who completed it?
I've never completed 2PC with DB2 JDBC driver type 4 driver (not type 2) whereas in my environment there were no problems with WMQv5.3.

One additional question is whether MQ base java requires client instance or not (DB2 client in this case).
In my understanding of JDBC driver type 4, it doesn't require client instance, but it seems that MQ does require DB2 client instance to work as a transaction manager and an environment variable 'DB2INSTANCE'.

Thanx,


Quote:
com.ibm.mq.MQException: MQJE001: completion code 2、reason 2195
at com.ibm.mq.MQQueueManager.commit(MQQueueManager.java:2279)
at Send2pc_t4.runSamp(Send2pc_t4.java:256)
at Send2pc_t4.main(Send2pc_t4.java:37)

Back to top
View user's profile Send private message
mvic
PostPosted: Tue May 23, 2006 5:20 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

JYama wrote:
Does MQ V6 really support JDBC driver type 4?

Since you're evidently seeing a problem, it seems best to advise you to call IBM Support and work this through with them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ with DB2 type 4 driver
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.