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 » multi-threaded program error 2219 or 2059

Post new topic  Reply to topic
 multi-threaded program error 2219 or 2059 « View previous topic :: View next topic » 
Author Message
rfirtion
PostPosted: Mon Mar 29, 2010 10:41 am    Post subject: multi-threaded program error 2219 or 2059 Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 8

All,

I have a multi-threaded program on OpenVMS and a Queue Manager with two queues. The main thread opens the input queue and does MQGETs and the 2nd thread opens the ouput queue and does MQPUTs.

When I make the connections to the MQServer with two different connection handles but the same channel name, I could open the queues, do the MQGET but would get error 2219 on the MQPUT, which I thought would be avoided with two different connection handles and two threads. The MQGET runs in the main thread every 1 sec.

When I used a different channel name for the two connections, I could open the input queue but never open the output queue. I would get error 2059, queue not available.

Does anyone know why and/or can point me to some good multi-threaded example code?

Thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Mar 29, 2010 1:35 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

We need more information...
MQ Version and patch level
Programming language (C, Java, JMS, etc...)
Code extracts

Baring that I would suggest you open a PMR...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Mon Mar 29, 2010 4:26 pm    Post subject: Re: multi-threaded program error 2219 or 2059 Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

rfirtion wrote:
but would get error 2219

2219 is MQRC_CALL_IN_PROGRESS

You should be able to take an MQ trace to verify what HConn MQ thinks you are using. If you can demonstrate MQ is at fault, then raise that PMR, as fjb_saper says.
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Mon Mar 29, 2010 10:49 pm    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

Looks like both threads are sharing the same Hconn. The previous Put/Get call on the Hconn has still not returned and another Put/Get call is being attempted from another thread.
Back to top
View user's profile Send private message
rfirtion
PostPosted: Wed Mar 31, 2010 11:04 am    Post subject: Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 8

Running MQ 6.0.1, code written in C, client running on VAX, server running on Windows:

I was able to get rid of the 2059 error by adding another channel on the MQ Server, but I still get the 2219 error.

So, I have one Queue Manager, two threads, two channels, and two connections handles (one for MQGET, one for MQPUT). I checked the values of the connection handles when they were created and again when they were used and they have different values, so I don't think the same handle is being used by both threads. (I will look into doing the trace though)

Does the MQ Server need to be set up to differently if I have two threads connecting to it as opposed to one?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 31, 2010 11:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rfirtion wrote:
Does the MQ Server need to be set up to differently if I have two threads connecting to it as opposed to one?


No. The queue manager can't distinguish that from 2 separate applications connecting to it.

Do the trace, ensure you've got 2 separate connection objects & if you have raised a PMR as previously advised.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gunter
PostPosted: Thu Apr 01, 2010 3:34 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

If you use more than one thread, you hav to connect in every thread to the queuemanager.

Read here "Scope of MQCONN or MQCONNX" and follow the link to "Shared (thread independent) connections with MQCONNX" :
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/fg12030_.htm
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
rfirtion
PostPosted: Fri Apr 02, 2010 6:42 am    Post subject: Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 8

The trace on the MQ Server doesn't say anything about the MQCONNX handle except:

mtsCheck in mqconnx - no object context, using LEGACY [pthconn=0 hconn=-999 hobj=-998 (-998) cc=-997 rc=-996]

MQOPEN indicates it is giving me the same connection handle for both connections but different HObjs...

SHCON:000001 !! - MQI:MQOPEN HConn=00000001 HObj=009F2A88 rc=00000000 ObjType=00000001 ObjName=To_Q

SHCON:000001 !! - MQI:MQOPEN HConn=00000001 HObj=009F6BA8 rc=00000000 ObjType=00000001 ObjName=From_Q


I issue two MQOPENs and two MQCONNX calls with two different handles and two different channel names.

In the main part of the program:

ConnectToQueueManager(pMQConfigData,&QMConnectHandle,str);

MQOPEN(QMConnectHandle, /* connection handle 1 */
&InputObjectDescriptorT, /* object descriptor for queue */
InputOpenOptions, /* open options */
&InputQHandleObject, /* object handle */
&OpenReadQCompletionCode, /* completion code */
&OpenInputQReasonCode); /* reason code */


In the tread:

ConnectToQueueManager(pMQConfigData,&QMConnectHandle2,str);

MQOPEN( QMConnectHandle2, /* connection handle 2 */
&OutputObjectDescriptorT, /* object descriptor for queue */
OutputOpenOptions, /* open options */
&OutputQHandleObject, /* object handle */
&OpenWriteQCompletionCode, /* completion code */
&OpenOutputQReasonCode); /* reason code */

I get completion and reason codes of 0 back from MQOPEN and MQCONNX. Not sure what to look at next....
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Apr 02, 2010 7:03 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Well on the server side, it thinks you ARE using the same hconn.

If you are sure that in your client you are NOT using the same hconn, raise the PMR that has been mentioned. Be prepared to share all of your MQ traces with the IBM support teams, so that you can prove your point.
Back to top
View user's profile Send private message
rfirtion
PostPosted: Mon Apr 12, 2010 8:25 am    Post subject: Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 8

IBM support tells me that as of V5.3, using MQCONN return the same handle for all connections from one application, even if it is multi-threaded. (Still trying to find out if it also applies to MQCONNX. Here's the tech note:

http://www-01.ibm.com/support/docview.wss?uid=swg21137795
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Apr 12, 2010 8:46 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
IBM support tells me that as of V5.3

Please be more specific.

What qmgr version/release/csd level?

What client version/release/csd level?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 12, 2010 6:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Looks to me like your code is opening 2 different queues on the same connection. You showed the opening of the queues, not the creation/opening of the connection.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rfirtion
PostPosted: Tue Apr 13, 2010 9:36 am    Post subject: Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 8

The ConnectToQueueManager function calls the MQCONNX function, using the passed in connectionHandle variable (different for each call). I got two different connection handles (seen on the server logs) once I set the connection option to MQCNO_HANDLE_SHARE_NONE. However, I still get the 2219 error on the MQPUTs.
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 » multi-threaded program error 2219 or 2059
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.