MQSeries not closing connections

I got this error while connecting to MQSeries:

MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009

After some trial-and-error, I found the problem: MQ’s InitialContext opens a connection, but only closes it if I close the IC itself:

ic.close();

Since my application creates a lot of instances of InitialContext, a lot of connections got leaked, giving that annoying error.

+1 to the IBM’s hall-of-shame, section “useless error messages”.

Tags: , , , ,

2 Responses to “MQSeries not closing connections”

  1. java problem Says:

    […] Website. Lang Code Project is proudly powered by WordPress. Entries (RSS) and Comments (RSS) …Extreme Java Blog Archive MQSeries not closing connectionsAfter some trial-and-error, I found the problem: MQ’s InitialContext opens a connection, but only […]

  2. Saif Windows XP Mozilla Firefox 3.6.3 Says:

    Hi,

    Same error i am facing, can you please help me, How did U closed the MQJ connection.

    Thanks

    Saif

Leave a Reply