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 » General IBM MQ Support » Do MQGETs need an MQCMIT?

Post new topic  Reply to topic
 Do MQGETs need an MQCMIT? « View previous topic :: View next topic » 
Author Message
Rabbit
PostPosted: Mon Feb 09, 2004 5:08 am    Post subject: Do MQGETs need an MQCMIT? Reply with quote

Newbie

Joined: 09 Feb 2004
Posts: 8

We have a vb app. which does a distructive get from a shared Q that is written to via another application.

Each message is one isolated unit of work and all we do is an MQGET.

The question is - Do we have to issue a MQCMIT/MQBACK for every MQGET?

If this is the case then is there an auto commit option available?

Thanks,

Chris.
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Feb 09, 2004 5:27 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

if you use mqgmo_syncpoint, you need to commit/backout, otherwise it is not in a unit of work so effectively committed immediately.
Back to top
View user's profile Send private message
Rabbit
PostPosted: Mon Feb 09, 2004 5:41 am    Post subject: No Syncpoint on MQPUT effects... Reply with quote

Newbie

Joined: 09 Feb 2004
Posts: 8

Ah Ha!

Thanks Jason - Things are becoming more clear.

In a different application (actually a single service) we do MQPUTs and without using sync points (mqpmo_syncpoint) do an MQCMIT/MQBACK after every one (again each a single unit of work).

This apparently was to avoid locking the queue. This seems to work however without using a syncpoint here, could it (or indeed the MQGET above) have any bearing on the following system issue:

Quote:
CSQJ317I ARCHIVE LOG QUIESCE PERIOD EXPIRED. NUMBER OF OUTSTANDING URS=1. ARCHIVE LOG PROCESSING WILL BE TERMINATED, AND UPDATE ACTIVITY WILL BE RESUMED.


Thanks....
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Feb 09, 2004 7:27 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

If you put or get without syncpoint, it happens - You cannot commit or back it out as there is nothing to be committed or backed out! A MQBACK / MQCMIT call when there is nothing to commit or backout will work (ie nothing failed) as far as I know

As to the error, I doubt it - You are not holding onto any resources if you are not using syncpoint other than the queue and connection handle. But I dont know the mainframe MQ very well either...!
Back to top
View user's profile Send private message
abiram8
PostPosted: Thu Feb 12, 2004 11:23 pm    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 207
Location: India

Hi guys,

I have a requirment where I have to commit to the queue level.

ie., my java application puts same instance of mqMessage to two queues.

To my knowledge the commit to Queuemanager level (QM.commit()) will not be help full since it may be similar to batch commit.

My requirment is to have after each put in the two queues the commit should happen.

like ..

do something with mqmsg ......

start
mqput(mqmsg,queue1)
mqput(mqmsg,queue2)
Commit:

If any one fails rollback

IF both succesfull commit the opration.


Looking for your valuable inputs.

Abiram
Back to top
View user's profile Send private message Send e-mail
JasonE
PostPosted: Fri Feb 13, 2004 1:57 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

I'm not clear what you are trying to do.

If you want either both or neither messages on the queue, since a unit of work is per hconn, so if you do
MQCONN
MQOPENx2
MQPUT under syncpoint to q1
MQPUT under syncpoint to q2
MQCMIT / MQBACK

Therefore any failure, both get backed out, otherwise if the commit runs, both are committed.

If you want to commit the messages seperately, you cant but I dont see why you would need to do that. You could do
MQPUT, MQCMIT, MQPUT, MQCMIT or not use syncpoint at all (but then it wouldnt get rolled back on failure).
Back to top
View user's profile Send private message
abiram8
PostPosted: Fri Feb 13, 2004 5:35 am    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 207
Location: India

Hi Jason,

Thanks for Ur Reply.

How to achive this.

I want to do a batch commit

(Both the queue belong to same Queue Manager).

Case 1) For Single Message.
Get the message with Syncpoint from one Queue.
Put the message to syncpoint to another Queue.
Commit

If any One Fails
Rollback all operation.

Case 2) same as above but its for bacth of messages

Is it possible

Abiram
Back to top
View user's profile Send private message Send e-mail
JasonE
PostPosted: Fri Feb 13, 2004 5:58 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

I think you mean:
mqget gmo_syncpoint
mqput pmo_syncpoint
mqget gmo_syncpoint
mqput pmo_syncpoint
mqget gmo_syncpoint
mqput pmo_syncpoint
etc
mqcmit or if any problem occurs mqback

Yes, this will work fine, ie you either commit all the gets/puts or none of them. The only limit to watch out for is the qmgr property MAXUMSGS which is the maximum number of uncommitted messages you can handle qmgr wide.
Back to top
View user's profile Send private message
abiram8
PostPosted: Fri Feb 13, 2004 6:06 am    Post subject: Reply with quote

Master

Joined: 27 Mar 2002
Posts: 207
Location: India

Hi JasonE,

Thanks for driving me in correct direction.

Iam going to try each cases using my own sample example.

Abiram
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Do MQGETs need an MQCMIT?
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.