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 IndexGeneral IBM MQ SupportHowto Resolve 2042 (MQ_OBJECT_IN_USE)

Post new topicReply to topic
Howto Resolve 2042 (MQ_OBJECT_IN_USE) View previous topic :: View next topic
Author Message
matth
PostPosted: Wed Mar 28, 2007 9:15 am Post subject: Howto Resolve 2042 (MQ_OBJECT_IN_USE) Reply with quote

Apprentice

Joined: 13 Feb 2007
Posts: 44
Location: Brazil

Hi:

Problem: I have an application (in Java) which connects on a remote MQSeries Server, with MQI. I don´t know why, but some threads in this application hangs and the queue on MQ remains locked.

The application can handle with this problem; discards old connection and make other, but when it will get messages, error 2042 ocours.
(The QUEUE is NOSHARE and I believe that change it to SHARE isn´t a
good idea).

I want any way to identify this hanged process in MQ (perhaps with DISPLAY CHSTATUS(SYSTEM.DEF.SRVCONN) and to unlock queue, by killing right processes. There are any sollution like this? How may I identify one process associated with an connection on MQServer?

Regard´s
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Wed Mar 28, 2007 11:11 am Post subject: Re: Howto Resolve 2042 (MQ_OBJECT_IN_USE) Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

matth wrote:
Hi:

Problem: I have an application (in Java) which connects on a remote MQSeries Server, with MQI. I don´t know why, but some threads in this application hangs and the queue on MQ remains locked.



Fixing this is probably what really needs to be done and may very well negate the need for the rest of the post.

matth wrote:


The application can handle with this problem; discards old connection and make other, but when it will get messages, error 2042 ocours.



So the application hangs and you just blow the connection out of the water? That doesn't sound like the application is handling the problem very well to me. Assuming that the application knows when it is hung, it should probably close the queue before blasting away the connection handle.

When you say 'the application is hanging'....what exactly is 'hanging'? A MQGET hanging? Just not responding to anything? What exactly do you mean by hanging?

matth wrote:

(The QUEUE is NOSHARE and I believe that change it to SHARE isn´t a
good idea).


Why not? Shared queues are perfectly workable especially if you are eventually intenteding to spawn off multiple iterations of the same application.
Back to top
View user's profile Send private message
matth
PostPosted: Wed Mar 28, 2007 12:33 pm Post subject: Re: Howto Resolve 2042 (MQ_OBJECT_IN_USE) Reply with quote

Apprentice

Joined: 13 Feb 2007
Posts: 44
Location: Brazil

Quote:
Fixing this is probably what really needs to be done and may very well negate the need for the rest of the post.


Ok, but we counldn´t find any reason for this until today. Normally, connections end with error 2195 (Unexcepted error), after that any try to use this connect returns 2009 (Invalid Connection).

Application tries to close connection, but it´s returns 2009 too (of course).

Error 2195 should generate a FDC file, but I´ve not found anything in MQSeries log dir, about that and no logs in AMQERRO1.LOG (General errors).

So, I need to handle with this problem in MQ-side

Quote:

matth wrote:

(The QUEUE is NOSHARE and I believe that change it to SHARE isn´t a
good idea).


Why not? Shared queues are perfectly workable especially if you are eventually intenteding to spawn off multiple iterations of the same application.


If this error ocours after a message-get and before one Connection-close, this message will not disappear? I understand that use of SHARE to get messages will work to get other messages, but how to free the locked
message?
[/quote]
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Thu Mar 29, 2007 1:23 am Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

Try
Code:
dis qs(<your_qname>) type(handle) all


You should get an output similar to the following sample:

Code:
AMQ8450: Display queue status details.
   QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE)       PID(1001)
   APPLTAG(amqpcsea)                       TID(1)
   APPLTYPE(SYSTEM)                        CHANNEL()
   CONNAME()                               BROWSE(NO)
   INPUT(EXCL)                             INQUIRE(YES)
   OUTPUT(NO)                              SET(NO)
   USERID(mqm)


The attributes PID and TID show the process and thread ID of the process(es), which has/have opened the queue. The attributes APPLTAG shows you the name of the application(s).

You may get more than one output per queue, if more than one process/thread has opened the queue.
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
blackevil
PostPosted: Thu Mar 29, 2007 4:13 am Post subject: Reply with quote

Newbie

Joined: 29 Mar 2007
Posts: 2

HubertKleinmanns wrote:
Try
Code:
dis qs(<your_qname>) type(handle) all


You should get an output similar to the following sample:

Code:
AMQ8450: Display queue status details.
   QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE)       PID(1001)
   APPLTAG(amqpcsea)                       TID(1)
   APPLTYPE(SYSTEM)                        CHANNEL()
   CONNAME()                               BROWSE(NO)
   INPUT(EXCL)                             INQUIRE(YES)
   OUTPUT(NO)                              SET(NO)
   USERID(mqm)


The attributes PID and TID show the process and thread ID of the process(es), which has/have opened the queue. The attributes APPLTAG shows you the name of the application(s).


You may get more than one output per queue, if more than one process/thread has opened the queue.




I am from Chinese,My English is not goodC but I have got the same question:

I open the Queue with Exclusive, code:

get_options.Options = MQGMO_WAIT;
QGET(qm_handle, que_handle, &msg_desc, &get_options, buffer_length,
buffer,&message_length,&comp_code, &reason);

now,return error :MQGET Failed,QUE=QBQ,Reason=2009.
then,I close and disconnect ,also return 2009.

then,I again open ,return 2042 error.

1)In MQ serverChow release the lock"?
2)In my application,how to do but with SHARE mode?
Back to top
View user's profile Send private message
anantha sreenivasan
PostPosted: Thu Mar 29, 2007 4:31 am Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2006
Posts: 72

What MQ Series Patch level you are using?
If it is CSD04 or CSD07, there is a problem. Even if a queue object is not held by any application, the error code returned will be 2042 - MQRC_OBJECT_IN_USE. This problem has been fixed in CSD12.

Recycling the queue manager and reconnecting should go through fine.
Also mqrc 2009, tells that the application needs to try connecting to the queue manager until the connection succeeds
Back to top
View user's profile Send private message
blackevil
PostPosted: Thu Mar 29, 2007 4:59 pm Post subject: Reply with quote

Newbie

Joined: 29 Mar 2007
Posts: 2

1)Thanks.If we want solve this problem,should we use CSD12?
2)If MQ Series Patch Level is CSD04,can this method solve this problem? now,I use MQ 5.3 CSD 04 .
3)about mqrc 2009,again I connect the queue manager,it is ok;but then I open queue manager,it return 2042.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 29, 2007 10:43 pm Post subject: Reply with quote

Grand High Poobah

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

blackevil wrote:
I use MQ 5.3 CSD 04 .


I would certainly consider an upgrade. Seriously consider. Soon.

I'd go all the way to CSD12. But that's just me.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportHowto Resolve 2042 (MQ_OBJECT_IN_USE)
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.