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 API Support » Problem with qMgr.disconnect(); Help please!!

Post new topic  Reply to topic
 Problem with qMgr.disconnect(); Help please!! « View previous topic :: View next topic » 
Author Message
rog552003
PostPosted: Sun Dec 11, 2005 11:51 am    Post subject: Problem with qMgr.disconnect(); Help please!! Reply with quote

Novice

Joined: 11 Dec 2005
Posts: 11

Hello, I work for an inssurance company in Mexico, and i have the following problem:

I make a connection to a queueManager, then i connect to a queue using accessQueue, this works fine, if I check the connections in the channel, i see that there is one connection active, everything ok.

I use the following code to close the connection after performing the "put":


public boolean cerrarConexion()
{
try{
queue.close();
qMgr.close();
qMgr.disconnect();
return true;
}catch (Exception e){
return false;
}
}

If i use this code in a java program, it works just fine, it closes the connection and everything is all right, but if i run it from a WebApplication running in WAS, it doesn`t work!!! After the executing the code, if i use isConnected() or isOpen(), the API says that everything is closed, that everything is all right, but if i check the console of MQSeries, the channel still have the connection active!! This only happens if i run it inside a bean in WAS.

I'm confused, can anybody help me? My code is so simple i can't believe it doesn't work!!

I'm using MQSeries 5.3 and WAS 5.1.1
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Dec 11, 2005 12:03 pm    Post subject: Reply with quote

Grand High Poobah

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

Well if you run inside WAS you should be using JMS!
It allows you as well pooling of the connections.

Especially if you use MDBs you will have open connections until either all MDBs have been stopped or WAS is being shutdown.

If you use MDB's remember that the app server (container) WAS destroys them at it's own convenience. Maybe you should release resources on passivate and call finalize on destroy and release resources...

Your try catch block should not include all the close operations. Each close operation should be in it's own try catch block.

Enjoy
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 API Support » Problem with qMgr.disconnect(); Help please!!
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.