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 » Closing session/connection blocks?

Post new topic  Reply to topic
 Closing session/connection blocks? « View previous topic :: View next topic » 
Author Message
steffi2
PostPosted: Wed Sep 30, 2009 10:06 am    Post subject: Closing session/connection blocks? Reply with quote

Apprentice

Joined: 04 Sep 2009
Posts: 31

So I'm testing my application's ability to reestabilish it's connection to the queue manager. I notice that when I get my server guy to kick me off the queue I get a

E_JMS_CONNECTION_PROBLEM clientId: null : MQJMS2002: failed to get message from MQ queue; nested exception is
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2202javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:540)
at com.ibm.mq.jms.MQQueueReceiver.getMessage(MQQueueReceiver.java:1730) at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:828) at com.ibm.mq.jms.contact admin.run(contact admin.java:401)
at java.lang.Thread.run(Thread.java:637)

and my ExceptionListener does

JMSUtilities.close(receiver, log);
//JMSUtilities.close(session, log);
//JMSUtilities.close(connection, true, log);

if I try to close the session or the connection I JMS will block and the async delivery thread doesn't go any further. So I can currently
reestabilish connectivity by not doing that but where is the documentation that says that I shouldn't close either session or connection?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 30, 2009 7:25 pm    Post subject: Reply with quote

Grand High Poobah

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

Have you checked the meaning of Reason Code 2202?

In any case you should stop the connection before setting a message listener to null. (way to remove it.)
You should also close the receiver, session, and connection.
This will prevent a connection leak.

Read up on standard JMS and JMS good practice. IIRC sun has a good JMSTutorial...

Have fun
_________________
MQ & Broker admin
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 » IBM MQ Java / JMS » Closing session/connection blocks?
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.