Author |
Message
|
Rabbit |
Posted: Mon Feb 09, 2004 5:08 am Post subject: Do MQGETs need an MQCMIT? |
|
|
 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 |
|
 |
JasonE |
Posted: Mon Feb 09, 2004 5:27 am Post subject: |
|
|
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 |
|
 |
Rabbit |
Posted: Mon Feb 09, 2004 5:41 am Post subject: No Syncpoint on MQPUT effects... |
|
|
 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 |
|
 |
JasonE |
Posted: Mon Feb 09, 2004 7:27 am Post subject: |
|
|
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 |
|
 |
abiram8 |
Posted: Thu Feb 12, 2004 11:23 pm Post subject: |
|
|
 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 |
|
 |
JasonE |
Posted: Fri Feb 13, 2004 1:57 am Post subject: |
|
|
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 |
|
 |
abiram8 |
Posted: Fri Feb 13, 2004 5:35 am Post subject: |
|
|
 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 |
|
 |
JasonE |
Posted: Fri Feb 13, 2004 5:58 am Post subject: |
|
|
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 |
|
 |
abiram8 |
Posted: Fri Feb 13, 2004 6:06 am Post subject: |
|
|
 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 |
|
 |
|