Author |
Message
|
Feysn |
Posted: Thu Dec 15, 2005 1:10 am Post subject: Server connections remain after dataflowengine restart |
|
|
Apprentice
Joined: 04 Jun 2004 Posts: 33 Location: Wilrijk
|
All,
I developped a node which builds up a MQ connection in the initialisation phase of the node. Whenever the dataflowengine.exe restarts the connections are build up again because the node is reinitialized.
Problem is that the connections remain open and the QM's where I connected to are running against their limit. Of course I can set the open connection parameter higher but this not the good way to do.
Is there a way to close those hanging connections?
WBIMB 5.0 CSD 4
Running on Windows 2000 server.
MQ 5.3 CSD 11 fix 11 |
|
Back to top |
|
 |
wschutz |
Posted: Thu Dec 15, 2005 2:39 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If you are obtaining a resouce in your plugin node, you shoulsd release it in the onDelete() method (java) or the _deleteNodeContext function (c). Are you doing that? _________________ -wayne |
|
Back to top |
|
 |
Feysn |
Posted: Thu Dec 15, 2005 3:04 am Post subject: |
|
|
Apprentice
Joined: 04 Jun 2004 Posts: 33 Location: Wilrijk
|
Yes, wschutz I'm clossing all the connections in the onDelete Method. The problem is when the dataflow engine stop unexpected then it is automatically restarted. I think that the onDelete method isn't executed then.
Code: |
public void onDelete()
{
if(DEBUG) log ("onDelete ");
if (initialized)
{
try
{
for(int i=0;i<qAmount;i++)
{
if(DEBUG)log("closing queue "+qNames[i][0]);
if(lq[i]!=null)
lq[i].close();
}
if(DEBUG) log ("disconnecting");
//qMgr.disconnect();
for(int i=0;i<QMS.size();i++)
{
QMtoAdd myQM = (QMtoAdd) QMS.elementAt(i);
QueueManagers[getQMid(myQM.QMName)].disconnect();
}
}
catch (MQException ex)
{}
try
{
if(sw!=null)
sw.close();
}
catch(IOException ioe){}
}
initialized = false;
}
|
With the node I connect to multiple QMs so that's the reason why I use the for loop. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Dec 15, 2005 3:22 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
The problem is when the dataflow engine stop unexpected then it is automatically restarted. I think that the onDelete method isn't executed then. |
Does that happen a lot? I wouln't expect the onDelete method to be called if there is an abnornal termination. Why is the engine terminating abnormally? Perhaps you need to fix that problem.
In any case, eventually MQ should recognize that your end of the connection has gone away and terminate it. _________________ -wayne |
|
Back to top |
|
 |
Feysn |
Posted: Thu Dec 15, 2005 4:11 am Post subject: |
|
|
Apprentice
Joined: 04 Jun 2004 Posts: 33 Location: Wilrijk
|
Wayne,
Seems that the connection remains open. Indeed when using normal send and receive channels the connection is terminated. But on svrconn channels this is not the case?
We are also investigating the reason why the dataflowengine restarts so often In de AbendFile for the EG there is an access voilation see below. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 15, 2005 4:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Try catch blocks not placed in a manner to ensure closure of each connection. If you run into the catch block on one of the connections the others in the for loop are ignored.
Not all exceptions are logged...
If any trouble closing any queues you will not disconnect from any qmgr...
Enjoy  |
|
Back to top |
|
 |
|