title: IBM Websphere MQ C# app - Reconnect after MQRC_Q_MGR_NOT_AVAILABLE
body: <p>I'm having the same issue as in post <a href="https://stackoverflow.com/questions/2973283/getting-error-reason-code-2059-on-mq-client-c-when-reconnecting-to-queuemanag">Getting error reason code 2059 on MQ client (C#) when reconnecting to QueueManager after awhile</a>.</p>
  
  <p>It's an intermitent problem. A server application which connects and disconnects from MQ using polling, sometimes receive a MQRC_Q_MGR_NOT_AVAILABLE. Even creating new connections at each poll, the application didn't recover automatically. It's a C# app, using standard MQ .NET Libraries.</p>
  
  <p>After restarting the service, it works normally. Usually the problem happens once a week and a half.</p>
  
  <p>For each poll, the new connection is created using:</p>
  
  <pre><code>manager = new IBM.WMQ.MQQueueManager(config.QueueManagerName);
  </code></pre>
  
  <p>The IBM.WMQ.MQQueueManager manager instance is stored in a private variable, and after the operations are done, the connection is closed, calling</p>
  
  <pre><code> manager.Disconnect();
   manager.Close();
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <p>I tried to simulate the problem, and even after 100.000 connections and disconnections it didn't happens :-(</p>
  
  <p>Any guesses?</p>