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 » Error 2059 from .NET client with multiple threads

Post new topic  Reply to topic
 Error 2059 from .NET client with multiple threads « View previous topic :: View next topic » 
Author Message
mindface
PostPosted: Fri Nov 12, 2004 8:42 am    Post subject: Error 2059 from .NET client with multiple threads Reply with quote

Newbie

Joined: 19 Oct 2004
Posts: 3

After some searching and reading quite a few postings related to 2059, I found that we still have this annoying issue open.

The error happens when we try to create a NEW queue manager object in different threads of the same C# client app (all pointing to the same manager), and the code is like:
queueManager= new MQQueueManager(ManagerName, MQC.MQCNO_HANDLE_SHARE_NONE);

And it happens ONLY RARELY: like once for every 100 messages (each is handled in a different thread with a new manager object).

We recently upgraded to WebSphere MQ Client 5.3 and .NET assembly used is amqmdnet.dll V1.0.0.3.

Additionally, we add such thread waiting/blocking before calling new MQQueueManager:
GlobalQueueCreationMutex.WaitOne();
The purpose is to avoid two threads creating managers at the same time. we found when 2 threads creating simutanously, we got 2059 all the time.

We also call Disconnect and Close (of the queue manager) once the thread finishes handling each message.

We also tried to pass hte queue manager object to each thread, which causes other problems (I believe we should really do that after reading the document)

I guess any help will be appreciated as we seem hitting a dead end in our research. Thanks!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 12, 2004 8:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you want to pass the handle, you will have to use the MQCNO option that will make the handle shareable.

Unless your threads are reading different queues, it may make more sense to merely pass messages into threads, rather than have each thread make a new QM and Queue connection.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mindface
PostPosted: Fri Nov 12, 2004 9:03 am    Post subject: Reply with quote

Newbie

Joined: 19 Oct 2004
Posts: 3

Thanks for such quick response. We actually started with passing the same queue manager object (or handle), or simply making it a global one, so that every thread uses the same object/handle, but we ran into some other errors.

Maybe it is just that we gave incorrect MQCNO option. May I ask what options should we use to ensure the manager working in the multiple threads?

Thanks again!
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Nov 12, 2004 10:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What is the value set for maxactivechannel & MaxChannels property for your queue manager?
Try increasing these values. I think the default is 100.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
mindface
PostPosted: Mon Nov 15, 2004 5:21 am    Post subject: Reply with quote

Newbie

Joined: 19 Oct 2004
Posts: 3

I did a little digging, and realize that passing handle is not an option for us: since we CANNOT settle down with either blocking or no blocking but with an error returned, when multiple therads try to use the same handle. (We need some true threading capability to access the same queue manager: one thread needs to sit there ALL THE TIME to listen to the new message and other threads just process one message and then use the same manager to REPLY)

The maximum channel setting: we already limit the # of threads to 10 and each thread has one queue manager and we did NOT forget disconnecting/closing the handle at the end of each thread.

So, I guess I have to dig more and seek further advice from you. Again, any help would be greatly appreciated.
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 » Error 2059 from .NET client with multiple threads
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.