Author |
Message
|
JYama |
Posted: Mon May 15, 2006 4:27 am Post subject: MQ with DB2 type 4 driver |
|
|
 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 |
|
 |
fjb_saper |
Posted: Mon May 15, 2006 5:37 pm Post subject: |
|
|
 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 |
|
 |
JYama |
Posted: Mon May 15, 2006 5:53 pm Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Mon May 15, 2006 6:01 pm Post subject: |
|
|
 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 |
|
 |
JYama |
Posted: Mon May 15, 2006 6:26 pm Post subject: |
|
|
 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 |
|
 |
mvic |
Posted: Tue May 16, 2006 12:57 am Post subject: Re: MQ with DB2 type 4 driver |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
JYama |
Posted: Tue May 16, 2006 11:59 pm Post subject: |
|
|
 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;
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 |
|
 |
mvic |
Posted: Wed May 17, 2006 10:29 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
JYama |
Posted: Mon May 22, 2006 5:04 am Post subject: |
|
|
 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 |
|
 |
mvic |
Posted: Tue May 23, 2006 5:20 am Post subject: |
|
|
 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 |
|
 |
|