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 » 2121 at qmgr.begin()

Post new topic  Reply to topic
 2121 at qmgr.begin() « View previous topic :: View next topic » 
Author Message
techno
PostPosted: Wed Aug 06, 2003 12:52 pm    Post subject: 2121 at qmgr.begin() Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Trying to do XA trnsactions with Oracle 9i, keeping MQ as transaction manager (5.3)

The statement qMgr.begin() is throwing 2121 reason code.

Can anybody help me?

Thanks
Shiva
Back to top
View user's profile Send private message
techno
PostPosted: Wed Aug 06, 2003 1:48 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

I opened the trace and I find that it throws 2018 first and then 2121.

02:42:14 [1060206134194] Thread: main, Object: com.ibm.mq.MQQueueManager@422ede ==> begin() entry
02:42:14 [1060206134195] Thread: main, Object: com.ibm.mq.server.MQSESSION@5f38fd ==> MQBEGIN() entry
02:42:14 [1060206134195] Thread: main, Object: com.ibm.mq.server.MQSESSION@5f38fd Conn Handle = 1
02:42:14 [1060206134196] Thread: main ==> XAtoJTA::resetRC() entry
02:42:14 [1060206134196] Thread: main ==> XAtoJTA::getInstance() entry
02:42:14 [1060206134197] Thread: main <== XAtoJTA::getInstance() exit
02:42:14 [1060206134197] Thread: main, Object: com.ibm.mq.XAtoJTA@26e85f resetting beginRC
02:42:14 [1060206134198] Thread: main <== XAtoJTA::resetRC() exit
02:42:14 [1060206134199] Thread: main ==> /build/j5304_D/src/native/mqi.c:1162::_MQBEGIN() entry
02:42:14 [1060206134200] Thread: main Class: /build/j5304_D/src/native/mqi.c:1190: : MQBEGIN call returned CC=2, RC=2018
02:42:14 [1060206134200] Thread: main <== /build/j5304_D/src/native/mqi.c:1196::_MQBEGIN() exit
02:42:14 [1060206134201] Thread: main ==> XAtoJTA::getRC() entry
02:42:14 [1060206134202] Thread: main ==> XAtoJTA::getInstance() entry
02:42:14 [1060206134202] Thread: main <== XAtoJTA::getInstance() exit
02:42:14 [1060206134203] Thread: main, Object: com.ibm.mq.XAtoJTA@26e85f returning beginRC=2121
02:42:14 [1060206134203] Thread: main <== XAtoJTA::getRC() exit
02:42:14 [1060206134204] Thread: main Class: MQSESSION overriding reason code from 2018 to 2121
02:42:14 [1060206134204] Thread: main, Object: com.ibm.mq.server.MQSESSION@5f38fd CC,RC = 2,2121
02:42:14 [1060206134205] Thread: main, Object: com.ibm.mq.server.MQSESSION@5f38fd <== MQBEGIN() exit
02:42:14 [1060206134205] Thread: main, Object: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2121 ==> MQException constructor(cc, rc, source)() entry
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Aug 06, 2003 1:56 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I found this in the IBM site
Code:
This is a known problem for which the following coding work around can be used within the Java application:


// This is the flag that causes MQ bindings to recognize that
// the thread must be bound to the HCONN for XA to function
// correctly.
mqProperties.put(MQC.THREAD_AFFINITY, newBoolean(true));
qm = new MQQueueManager(qmgrName, mqProperties);


May be you need to post the code and that might help.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
techno
PostPosted: Wed Aug 06, 2003 2:46 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

sds

Last edited by techno on Wed Aug 06, 2003 3:15 pm; edited 2 times in total
Back to top
View user's profile Send private message
techno
PostPosted: Wed Aug 06, 2003 2:49 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Code is...

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

// Create a XADataSource instance
OracleXADataSource oxds1 = new OracleXADataSource();
oxds1.setURL("jdbc:oracle:thin:@10.1.111.11:1111:xxxx");
oxds1.setUser("xxx");
oxds1.setPassword("xxx");

//Create a connection to the queue manager
java.util.Hashtable properties = new Hashtable();
properties.put(MQC.THREAD_AFFINITY, new Boolean(true));
qMgr =new MQQueueManager(qManager, properties);


FileOutputStream traceFile =new FileOutputStream("/home/mqm/xatest.out");
MQEnvironment.enableTracing(5, traceFile);

// Create DB Connection
java.sql.Connection con =qMgr.getJDBCConnection(oxds1, "xxx", "xxx" );
//java.sql.Connection con = null;
System.out.println("connection:"+con);

//Set up the options on the queue we wish to open...
//Note.All MQSeries Options are prefixed with MQC in Java.
int openOptions =MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;

//Now specify the queue that we wish to open,
//and the open options...
MQQueue testq = qMgr.accessQueue("TESTQ", openOptions);

System.out.println("testq:"+testq);
System.out.println("isConnected="+qMgr.isConnected());
qMgr.begin();

//Define a simple MQSeries message,and write some text in UTF format..
MQMessage hello_world =new MQMessage();
hello_world.writeUTF("Hello World!");

//specify the message options...
MQPutMessageOptions pmo =new MQPutMessageOptions();//accept the //defaults,

//same as MQPMO_DEFAULT
//put the message on the queue
testq.put(hello_world,pmo);

Statement stmt = con.createStatement();
String sql = "insert into MQXATEST(name, id) values ('shiva',100)";
stmt.executeQuery(sql);

qMgr.commit();

Thread.sleep(1000000);
//Close the queue...
testq.close();
qMgr.disconnect();
}
//If an error has occurred in the above,try to identify what went wrong
//Was it an MQSeries error?
catch (MQException ex)
{
System.out.println("An MQSeries error occurred :Completion code "+
ex.completionCode +"Reason code "+ex.reasonCode);
ex.printStackTrace();
}
catch (SQLException ex1)
{
System.out.println("An MQSeries error occurred :Completion code "+ex1);
// ex.completionCode +"Reason code "+ex1.reasonCode);
}

//Was it a Java buffer space error?
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer:"+ex);
}
catch (Exception ex2)
{
System.out.println("An error occurred whilst writing to the message buffer:"+ex2);
}


Last edited by techno on Wed Aug 06, 2003 3:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
techno
PostPosted: Wed Aug 06, 2003 3:04 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

MQJE001: Completion Code 0, Reason 2121


Trace :

exit
04:07:57 [1060211277549] Thread: MQBindingsQMThread0 <== /build/j5304_D/src/native/mqod.c:192::mqod_native_to_java() exit
04:07:57 [1060211277550] Thread: MQBindingsQMThread0 <== /build/j5304_D/src/native/mqi.c:565::_MQOPEN() exit
04:07:57 [1060211277551] Thread: main, Object: com.ibm.mq.MQOD@48aa23 ==> updateDistributionListItems() entry
04:07:57 [1060211277552] Thread: main, Object: com.ibm.mq.MQOD@48aa23 <== updateDistributionListItems() exit
04:07:57 [1060211277552] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 MQOPEN returning hObj 1074837832
04:07:57 [1060211277553] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 CC,RC = 0,0
04:07:57 [1060211277553] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 <== MQOPEN() exit
04:07:57 [1060211277554] Thread: main, Object: com.ibm.mq.MQQueueManager@93dcd Opened queue name = TESTQ
04:07:57 [1060211277555] Thread: main, Object: com.ibm.mq.MQQueueManager@93dcd <== accessQueue() exit
04:07:57 [1060211277556] Thread: main, Object: com.ibm.mq.MQQueueManager@93dcd ==> begin() entry
04:07:57 [1060211277556] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 ==> MQBEGIN() entry
04:07:57 [1060211277557] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 Conn Handle = 1302248
04:07:57 [1060211277558] Thread: MQBindingsQMThread0 ==> XAtoJTA::resetRC() entry
04:07:57 [1060211277558] Thread: MQBindingsQMThread0 ==> XAtoJTA::getInstance() entry
04:07:57 [1060211277559] Thread: MQBindingsQMThread0 <== XAtoJTA::getInstance() exit
04:07:57 [1060211277559] Thread: MQBindingsQMThread0, Object: com.ibm.mq.XAtoJTA@916a2 resetting beginRC
04:07:57 [1060211277560] Thread: MQBindingsQMThread0 <== XAtoJTA::resetRC() exit
04:07:57 [1060211277561] Thread: MQBindingsQMThread0 ==> /build/j5304_D/src/native/mqi.c:1162::_MQBEGIN() entry
04:07:58 [1060211278130] Thread: MQBindingsQMThread0 Class: /build/j5304_D/src/native/mqi.c:1190: : MQBEGIN call returned CC=0, RC=0
04:07:58 [1060211278131] Thread: MQBindingsQMThread0 <== /build/j5304_D/src/native/mqi.c:1196::_MQBEGIN() exit
04:07:58 [1060211278131] Thread: MQBindingsQMThread0 ==> XAtoJTA::getRC() entry
04:07:58 [1060211278132] Thread: MQBindingsQMThread0 ==> XAtoJTA::getInstance() entry
04:07:58 [1060211278132] Thread: MQBindingsQMThread0 <== XAtoJTA::getInstance() exit
04:07:58 [1060211278133] Thread: MQBindingsQMThread0, Object: com.ibm.mq.XAtoJTA@916a2 returning beginRC=2121
04:07:58 [1060211278133] Thread: MQBindingsQMThread0 <== XAtoJTA::getRC() exit
04:07:58 [1060211278134] Thread: MQBindingsQMThread0 Class: MQSESSION overriding reason code from 0 to 2121
04:07:58 [1060211278134] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 CC,RC = 0,2121
04:07:58 [1060211278135] Thread: main, Object: com.ibm.mq.server.MQSESSION@507fb2 <== MQBEGIN() exit
04:07:58 [1060211278136] Thread: main, Object: com.ibm.mq.MQException: MQJE001: Completion Code 0, Reason 2121 ==> MQException constructor(cc, rc, source)() entry
04:07:58 [1060211278140] Thread: main, Object: com.ibm.mq.MQException: MQJE001: Completion Code 0, Reason 2121 javabase/com/ibm/mq/MQException.java, java, j5304, j5304-L030506.2 03/05/02 15:09:05 @(#) 1.48.1.1
04:07:58 [1060211278140] Thread: main, Object: com.ibm.mq.MQException: MQJE001: Completion Code 0, Reason 2121 cc = 0
04:07:58 [1060211278141] Thread: main, Object: com.ibm.mq.MQException: MQJE001: Completion Code 0, Reason 2121 rc = 2121
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 » 2121 at qmgr.begin()
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.