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 » Getting Uncommited message from queue possible within job

Post new topic  Reply to topic
 Getting Uncommited message from queue possible within job « View previous topic :: View next topic » 
Author Message
emakaay
PostPosted: Fri Oct 17, 2003 12:15 am    Post subject: Getting Uncommited message from queue possible within job Reply with quote

Newbie

Joined: 16 Oct 2003
Posts: 9

Hello everybody,

I stumbled on some strange behaviour using MQSeries. When I put a message on a queue (with the PMO.syncpoint option on) and try to read that same message without committing first, I succeed. This is all done in the same session. This can't be true, can it ??

If I put a message on the queue in session x, and try to get the message from the queue in session y. I don't succeed. This is expected !!!!

system background
=============
Ok now time for some more system-background information.
* I'm programming on an AS/400 (V5R2M0)
* Using ILE-RPG
* I don't issue a MQDISC call (which normally causes non-committed messages to be committed)
* I use MQSEries v5.2

Program information
=============
And some more information on the programs i'm using
* I created a service program that has functions to simplify access to the MQI API. So programmers don't need to fill in MQMD, MQPMO and MQGMO options.
* While putting and getting messages from several queues I cache the required handles to queuemanagers and queues between calls. This is better for performance because I don't need to open and close queues every time I put or get a message. I take into account that a queue can be opened with different open options. A cached handle is only reused if the queuemanager/queue/openoptions are equal.
* I wrote 2 simple programs
1) calls the simplified put function within the service program
2) calls the simplified get function within the service program
Note: These programs are not ended with indicator LR on, and all work
in the same named activation group (used by the service program)

Detailed test scenario
==============
When I call the put program to please a message on a specific queue, then it is possible to read that non-committed message from the queue using my simple get program. This should not happen, because the message is not committed. But it does. Is this because everything is in one job/session ?????? I can't reproduce this scenarie when I put the message in as/400 session x, and try to get the message in as/400 session y.

Anyone with a brilliant explanation for this behaviour. Any help is appreciated. Thanks in advance.

Erik Makaay
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Fri Oct 17, 2003 12:51 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

maybe not brilliant but you are still controlling the uncommitted messages so why shouldn't you be able to get them while still in control? after all the uncommit is there so OTHERs can't get the messages until YOU are finished...

my 2 cents...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
emakaay
PostPosted: Fri Oct 17, 2003 1:03 am    Post subject: Reply with quote

Newbie

Joined: 16 Oct 2003
Posts: 9

Your 2 cents make sense BUT the manuals says that messages that are not commited can't be read from the queue. That's what's bothering me. I would like some documentation that tells me that this is default behaviour. And I can't find it

Thanks for replying though
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Fri Oct 17, 2003 1:37 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

It is definitely true that you can get a meesage in the same UOW that it was put. I don't have a documentation reference to it since I am at home.

I am not sure why the original MQ designers thought this was a valuable/necessary feature.
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
emakaay
PostPosted: Fri Oct 17, 2003 2:10 am    Post subject: Reply with quote

Newbie

Joined: 16 Oct 2003
Posts: 9

@ bob


Thanks for your quick reply . Could you point out to me where this behaviour is explained, when you're at work again. I would really appreciate this.

Erik
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Tue Oct 21, 2003 1:28 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

In the description of MQPMO_SYNCPOINT in the APR it says
Quote:
The request is to operate within the normal unit-of-work protocols. The message is not visible outside the unit of work until the unit of work is committed. If the unit of work is backed out, the message is deleted.


_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
emakaay
PostPosted: Tue Oct 21, 2003 2:11 am    Post subject: Reply with quote

Newbie

Joined: 16 Oct 2003
Posts: 9

Hello Bob,

Thanks for getting back to this issue. But I'm not completely satisfied with the answer. I would like a reference to a manual, that explains how a get works when you read message(s) from a queue you just put them on, yourself. In the same UOW.

The following piece of text
Quote:
The request is to operate within the normal unit-of-work protocols. The
message is not visible outside the unit of work until the unit of work is
committed. If the unit of work is backed out, the message is deleted.

describes that the result, from a mqput command, is not visible outside the unit of work. This is normal behaviour. I'm want a description how it works within the unit of work.

Hope you know a reference to a manual that describes this behaviour. If not I want to thanks you for the time and effort you already spent clarifying this problem

Erik
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Tue Oct 21, 2003 5:07 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

Quote:
BUT the manuals says that messages that are not commited can't be read from the queue
.
Which specific manual (and subsection) are you referring to?

In the quote I referenced the critical words are
Quote:
outside the unit of work
, without them you wouldn't be able to get within the same UOW.

The phrase
Quote:
normal unit-of-work protocols
in the description of both MQGMO_SYNCPOINT and MQPMO_SYNCPOINT whilst less precise is also significant since it refers to the behaviour of databases and other resources controlled by UOW protocols where it is normal behaviour for a UOW to have access to the changes that it has made before they are committed.

If you think that parts of IBM manuals are incorrect or misleading please send a note to mailto://idrcf@hursley.ibm.com with as much detail as possible so that the books can be improved in future editions.
_________________
Bob Buxton
Ex-Websphere MQ Development
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 » Getting Uncommited message from queue possible within job
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.