Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concern on the concept of syncpoint from WMQ

Tags:

ibm-mq

mq

I'm kind of confused about the syncpoint from WebSphere MQ. According to the reference from the WMQ Infocenter, the syncpoint is defined as below:

The decision to commit or back out the changes is taken, in the simplest case, at the end of a task. However, it can be more useful for an application to synchronize data changes at other logical points within a task. These logical points are called sync points (or synchronization points) and the period of processing a set of updates between two sync points is called a unit of work.

Therefore, a unit of work is named as processing between two sync points. From my understanding, that unit of work is a transaction actually. So I draw the picture here reflecting the relationship between them:

enter image description here

  1. Am I understanding it correctly?
  2. Another question here is as for the syncpoint, it's said to synchronize data for application, where is the data synced from and where to?

Thanks

like image 342
wing2ofsky Avatar asked Sep 27 '12 02:09

wing2ofsky


People also ask

What is syncpoint in MQ?

A syncpoint is a logical point in the execution of a program where changes made by the program can be saved. The message request operates within the unit of work: the message is not visible outside the unit of work until the unit of work is saved. If the unit of work is rolled backed, then the message is deleted.

What is sync point?

Definition: A synchronization point, or sync point , is a known point of data or system integrity. It is a point in time at which all of the changes made to the database are complete. If a failure makes restart necessary, you can begin reprocessing from the most recent sync point.

How do you commit uncommitted messages in MQ?

These uncommitted messages can be handled using "dspmqtrn" and "rsvmqtrn" command.

What is MQ commit?

A two-phase commit process is one in which updates that a program has made to IBM MQ queues can be coordinated with updates to other resources (for example, databases under the control of Db2® ). Under such a process, updates to all resources are committed or backed out together.


1 Answers

Answer 1: Yes, you are understanding it correctly. Transactions are atomic units of work that succeed or fail in their entirety. Syncpoints are the boundaries between the transactions. The subtle difference between a transaction and a syncpoint is that the work done under a transaction can be in-doubt for a period of time whereas the sync point is the state during which the transaction is not in doubt. In the event of failure, the queues are restored to the state which existed at the last syncpoint and then any pending transactions rolled back or, in the case of XA, possibly committed by the resource manager.

The Infocenter page Transaction management and support may explain it better than the page linked in the post.

Answer 2: The data is synchronized by the resource manager(s). For local units of work where messages are the only participants in the transaction, the synchronization occurs only in the queue, and the queue manager acts as both the resource manager and the transaction manager. For global units of work involving messages and database updates in the same transaction, the synchronization occurs in the QMgr and the database which act as resource managers. The transaction manager will either be MQ or an application server and it orchestrates the synchronization between the resource managers.

Regardless of whether the transaction is local or global (sometimes also referred to as single-phase commit or 2-phase commit) the relationship between transactions and syncpoints is the same. The syncpoint is the most recent point in time at which a known state is preserved and to which an in-doubt transaction might be rolled back.

like image 189
T.Rob Avatar answered Sep 30 '22 10:09

T.Rob