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 » C# and error code 2017

Post new topic  Reply to topic
 C# and error code 2017 « View previous topic :: View next topic » 
Author Message
KirTakat
PostPosted: Wed Sep 14, 2005 9:20 am    Post subject: C# and error code 2017 Reply with quote

Newbie

Joined: 22 Jul 2005
Posts: 6

I'm having an issue with IBM MQ throwing an exception after my program has been running for a while. After the application has been up for a (variable) period of time, it will start to throw a 2017 error (MQRC_HANDLE_NOT_AVAILABLE, basically the maximum number of open handles has been reached). There are other threads running at the same time, but they connect to different queues.

The relevant thread of the application basically works like this:

queueManager.Connect
while(running)
{
queue.Open
while(there are still messages on queue)
{
queue.get
<-- Error occurs here
}
queue.Close
}
queueManager.disconnect
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Wed Sep 14, 2005 9:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are all the threads connecting to the same qmgr, or different qmgrs?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Sep 14, 2005 9:35 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Are you sure thats being thrown from the get? It seems more likely that you'd get that from the open method.

You could always increase maxhandles on the queue manager....

EDIT: and also... why do you open and close the queue when you get "no more messages"? Why not just redrive the GET again? Based on what you posted, it looks like you in a tight loop of "open -> get (2033) -> close" when the queue is empty .....
EDIT2: (I don't know c#) but are you SURE that close method is getting executed when you handle the 2033 condition?
_________________
-wayne


Last edited by wschutz on Wed Sep 14, 2005 9:44 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address
KirTakat
PostPosted: Wed Sep 14, 2005 9:41 am    Post subject: Reply with quote

Newbie

Joined: 22 Jul 2005
Posts: 6

The threads are all connecting to the same queue manager, but the error always occurs in the same thread.

As for the queue.Open, no, it definately seems to be occuring during the queue.get.


Last edited by KirTakat on Wed Sep 14, 2005 9:45 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
KirTakat
PostPosted: Wed Sep 14, 2005 9:45 am    Post subject: Reply with quote

Newbie

Joined: 22 Jul 2005
Posts: 6

Quote:
why do you open and close the queue when you get "no more messages"?


Because this application runs 24/7 for days on end, but it's sleeping for 20 hours in a given day. And because the queue it's connecting to can be (never has been, but the functionality was requested) changed on the fly.

Edit: I know the close method is being called after I get the 2033.


Last edited by KirTakat on Wed Sep 14, 2005 9:49 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Wed Sep 14, 2005 9:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If all of the threads are connecting to the same qmgr, you're a lot better off opening it as a thread-shareable connection once, and using it in every thread, rather than opening a thread local connection in each thread.

If there aren't any guarantees in your design that it will be the same qmgr, then a simple connection pool will do a nice trick.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » C# and error code 2017
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.