Author |
Message
|
rfirtion |
Posted: Mon Mar 29, 2010 10:41 am Post subject: multi-threaded program error 2219 or 2059 |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Mar 29, 2010 1:35 pm Post subject: |
|
|
 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 |
|
 |
mvic |
Posted: Mon Mar 29, 2010 4:26 pm Post subject: Re: multi-threaded program error 2219 or 2059 |
|
|
 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 |
|
 |
shashikanth_in |
Posted: Mon Mar 29, 2010 10:49 pm Post subject: |
|
|
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 |
|
 |
rfirtion |
Posted: Wed Mar 31, 2010 11:04 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Wed Mar 31, 2010 11:59 am Post subject: |
|
|
 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 |
|
 |
gunter |
Posted: Thu Apr 01, 2010 3:34 am Post subject: |
|
|
Partisan
Joined: 21 Jan 2004 Posts: 307 Location: Germany, Frankfurt
|
|
Back to top |
|
 |
rfirtion |
Posted: Fri Apr 02, 2010 6:42 am Post subject: |
|
|
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 |
|
 |
mvic |
Posted: Fri Apr 02, 2010 7:03 am Post subject: |
|
|
 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 |
|
 |
rfirtion |
Posted: Mon Apr 12, 2010 8:25 am Post subject: |
|
|
Newbie
Joined: 04 Mar 2010 Posts: 8
|
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Apr 12, 2010 8:46 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Mon Apr 12, 2010 6:01 pm Post subject: |
|
|
 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 |
|
 |
rfirtion |
Posted: Tue Apr 13, 2010 9:36 am Post subject: |
|
|
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 |
|
 |
|