Author |
Message
|
nakuser |
Posted: Wed Oct 15, 2003 4:41 am Post subject: MQ Connections not closing |
|
|
Newbie
Joined: 24 Sep 2003 Posts: 5
|
We are connecting to MQ using an in-house written classes which encapsulates all the JMS code from everyone. This code has been audited externally by IBM.
We have a problem where we are connecting through MQ clients. At times the connections are not being dropped. This is problem because we have to bug the MQ administrator because we run out of connections. _________________ SCJP |
|
Back to top |
|
 |
mqonnet |
Posted: Wed Oct 15, 2003 4:55 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Similar issue is being dealt in the following thread.
http://www.mqseries.net/phpBB2/viewtopic.php?t=11209&highlight=
As an aside you could always increase the maxchannels and maxactivechannels for the qmgr in question.
Also make sure your client app does call MQDISC so that everything ends cleanly enough.
Cheers
Kumar |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Oct 15, 2003 5:41 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You didn't mention any code levels. Make sure that you are running with one of the later code levels (5.2 CSD4 or greater). There were problems with connections being hung onto that were solved. |
|
Back to top |
|
 |
nakuser |
Posted: Wed Oct 15, 2003 5:59 am Post subject: |
|
|
Newbie
Joined: 24 Sep 2003 Posts: 5
|
When you mean code levels I assume you mean JMS version. I will have a look at that.
Can the queue manager close connections that have been opened for a while and not in use? _________________ SCJP |
|
Back to top |
|
 |
mrlinux |
Posted: Wed Oct 15, 2003 6:19 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
He means MQSeries version and CSD _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
nakuser |
Posted: Thu Oct 16, 2003 1:53 am Post subject: |
|
|
Newbie
Joined: 24 Sep 2003 Posts: 5
|
We are running MQ 5.3 CSD5.
I think what happens is that if the application dies with out a commit being done, the connections that were close are not committed back to MQ.
I don't know if this makes sense. _________________ SCJP |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 16, 2003 5:34 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I would have said close rather than commit, and you may have hit on the actual problem. You need to explicitly close the connections or resources will get hung onto. You can get around this with some of the channel parameters (HBINT, KAINT). You might want to look into them. |
|
Back to top |
|
 |
nakuser |
Posted: Thu Oct 16, 2003 11:37 pm Post subject: |
|
|
Newbie
Joined: 24 Sep 2003 Posts: 5
|
This is the logic in the code we all use .
try {
// get connection
// connection start
// get session
// get queue
// get sender
// create message
//send message
} catch (JMSException jmsEx) {
throw new MessengerException(
"MessageConsumer->JMS Error code: "
+ jmsEx.getErrorCode()
+ "\n"
+ jmsEx.getMessage());
} catch (ServiceNotFoundException snfX) {
throw new MessengerException(
"MessageConsumer->JMS Error code: " + "\n" + snfX.getMessage());
} finally {
//close sender.
// close session.
//close connection
}
return messageId;
}
The connections are closed some of the time. The commiting or rolling back of the transaction is outside of this class or around it. It depends on whether it was started in a transaction scope or not.
So we are testing some code locally thus going to other serves using MQ client.
I would love to know why the code say "close" but the connections are still dangling. This is a real problem. _________________ SCJP |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Oct 17, 2003 4:51 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You mentioned that the connections are closed some of the time. Do you mean that you sometimes close them or that they are always closed and sometime MQ closes them? You also mentioned that they are hanging around. What does netstat show as the status for the connections? |
|
Back to top |
|
 |
|