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 » [MQSeries v5.3] Error 2042 - Objetc in use

Post new topic  Reply to topic
 [MQSeries v5.3] Error 2042 - Objetc in use « View previous topic :: View next topic » 
Author Message
Bahan
PostPosted: Fri Apr 06, 2007 4:50 am    Post subject: [MQSeries v5.3] Error 2042 - Objetc in use Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Hi, i'm currently using MQseries 5.3 on an AIX 4.3 system and in my C program, I noticed some strange error code which appears sometimes : 2042.

Does that mean that when someone is opening the queue to put a message in it, someone else cannot open the queue to get messages ?

Is it the way it works ?

Thanks for your answers.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 06, 2007 7:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It depends on what options are specified when someone opens it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 09, 2007 8:30 am    Post subject: Reply with quote

Grand High Poobah

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

This of course includes how you open the queue.

The Application Programming Guide will (perhaps obviously) guide you in this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Apr 09, 2007 11:52 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

It is in C language.

Here is the code to open the queue :

Code:
/*
* -- ---------------------------------------------------------
* Opening queue
* -- ---------------------------------------------------------
*/
mqOptionOpen = MQOO_INPUT_EXCLUSIVE | MQOO_FAIL_IF_QUIESCING;

strcpy(stDescObj.ObjectName, szQueue);
strcpy(stDescObj.ObjectQMgrName, szQueueManager);

MQOPEN(mqConnection, &stDescObj, mqOptionOpen, &mqObj, &mqCrOpening, &mqErrorCode);


Do you think my "problem" comes from the variables mqOptionOpen ?

Quote:
The Application Programming Guide will (perhaps obviously) guide you in this.


Hum, do you know where I can find it ?

Thanks.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 10, 2007 12:06 am    Post subject: Reply with quote

Grand High Poobah

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

Bahan wrote:

Do you think my "problem" comes from the variables mqOptionOpen ?


I think if you want 2 applications to open the same queue at the same time, specifying exclusive access as an option will not be helping....

Bahan wrote:

Quote:
The Application Programming Guide will (perhaps obviously) guide you in this.


Hum, do you know where I can find it ?


I find it amazing that you can look through this forum and manage to avoid seeing both the documentation button at the top of this page & this link peppered through it:

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp

But then, I always find it amazing. Maybe I'm easily amazed. You're certainly not the first person to miss it. In fact, not the thousanth I suspect. Maybe it's me....

There are also PDF versions of the manuals on the IBM site if you prefer them.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Tue Apr 10, 2007 3:07 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Sorry about that
It is my mistake.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 10, 2007 3:10 am    Post subject: Reply with quote

Grand High Poobah

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

Bahan wrote:
Sorry about that
It is my mistake.


All mistakes are steps on the path of learning.

(Unless of course it's a major blunder in a live production system! That's harder to pass off as a learning experience... )
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Tue Apr 17, 2007 8:20 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Hum, I have another question about MQOO_INPUT_SHARED.

Quote:
MQOO_INPUT_SHARED

public final static int

Open the queue to get messages with shared access. The queue is opened for use with subsequent MQGET calls. The call can succeed if the queue is currently open by this or another application with MQOO_INPUT_SHARED, but fails with reason code MQRC_OBJECT_IN_USE if the queue is currently open with MQOO_INPUT_EXCLUSIVE.


But in this description, it doesn't describe the following case : What happen if I open the queue while it is already opened by someone else. I mean, will I get the full messages put in it ? Or is it a risk that I get only a part of a message ?

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 17, 2007 8:23 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If two applications have a queue open, both with INPUT_SHARED, then it is not specified(in the general case) which application will receive a given message.

However, it is never the case that an MQ application will receive anything less than a complete MQ message.

To be more specific about that first point, given two GETS that have the same criteria, it is not specified which one will receive a particular message that matches that criteria. However, one and only one of those GETs will receive the message and it will always receive the full message.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bahan
PostPosted: Tue Apr 17, 2007 11:46 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Thanks for your answer.

In fact, in my case, I have two applications which open the queue at the same time, but the first one will only put messages into it and the other one will only gets the messages.

Thanks again.

Bahan
_________________
Close the world.||.txen eht nepO
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 » [MQSeries v5.3] Error 2042 - Objetc 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.