Integration Server 10.15 | Publish-Subscribe Developer’s Guide | Synchronizing Data Between Multiple Resources | Data Synchronization with webMethods | Echo Suppression for N-Way Synchronizations | How the isLatchClosed Field Is Used for Echo Suppression
 
How the isLatchClosed Field Is Used for Echo Suppression
In addition to the appID, objectId, nativeId, and canonicalKey fields that are described in Key Cross-Referencing and the Cross-Reference Table, the cross‑reference table also includes the isLatchClosed field. The isLatchClosed field acts as a flag that indicates whether an object managed by a resource (e.g., account information) is allowed to be updated or whether a data change has already been made to the object and therefore should not be made again.
*When the isLatchClosed field is false,this indicates that the latch is open and therefore updates can be made to the object.
*When the isLatchClosed field is true, this indicates that the latch is closed and therefore updates should not be made to the object.
The following diagram illustrates how to use the isLatchClosed field for echo suppression during data synchronization.
Step
Description
1
A data change occurs on a source, and the source sends a notification document.
2
A notification service that you create to notify targets of a data change invokes the pub.synchronization.latch:isLatchClosed built‑in service to determine whether the latch for the object is open or closed. Initially for the source, the latch for the object that was changed is open. This indicates that updates can be made to this object.
The object is identified in the cross-reference table by the following cross-reference table fields and the latch is considered open because isLatchClosed is false:
appId
objectId
canonicalKey
isLatchClosed
CRM system
Account
WM6308
false
Finding that the latch is currently open, the notification service builds the canonical document and publishes it. The notification service invokes the pub.synchronization.latch:closeLatch built-in service to close the latch. This sets the isLatchClosed field to true and indicates that updates cannot be made to this object and prevents a circular update. After the latch is closed, the cross‑reference table fields are as follows:
appId
objectId
canonicalKey
isLatchClosed
CRM system
Account
WM6308
true
3
Because the source is also a target, it subscribes to the canonical document it just published. The trigger passes the canonical document to a service you create to update the resource when a data change occurs. This update service invokes the pub.synchronization.latch:isLatchClosed built‑in service to determine whether the latch is open or closed for the object.
Finding that the latch is currently closed, which indicates that the change has already been made, the update service does not make the update to the object. The update service invokes the pub.synchronization.latch:openLatch built‑in service to re‑open the latch to allow future updates to the object. After the latch is open, the cross‑reference table fields are as follows:
appId
objectId
canonicalKey
isLatchClosed
CRM system
Account
WM6308
false
4
A service you create to update the target when a data change occurs receives the canonical document. This update service invokes the pub.synchronization.latch:isLatchClosed built‑in service to determine whether the latch is open or closed for the object. Initially, the cross‑reference table fields for the target object are as follows:
appId
objectId
canonicalKey
isLatchClosed
Billing system
Account
WM6308
false
Because initially the isLatchClosed column is set to false, this means the latch is open and updates can be made to this object. To make the update, the update service maps information from the canonical document to a native document for the target resource and sends the document to the target. The target resource uses this document to make the equivalent change.
The update service uses the pub.synchronization.latch:closeLatch built-in service to close the latch. This indicates that updates cannot be made to this object and prevents a circular update. After the latch is closed, the cross‑reference table fields are as follows:
appId
objectId
canonicalKey
isLatchClosed
Billing system
Account
WM6308
true
5
Because the target made a data change, it sends notification of a change.
6
Because the target is also a source, when it receives notification of a data change, it attempts to notify other targets of the data change. A notification service that you create to notify targets of a data change invokes the pub.synchronization.latch:isLatchClosed built‑in service to determine whether the latch for the object is open or closed.
Finding that the latch is closed, which indicates that the change has already been made, the notification service does not build the canonical document. The notification service simply invokes the pub.synchronization.latch:openLatch built‑in service to re-open the latch. Because the latch is now open, future updates can be made to the object. After the latch is open, the cross‑reference table fields are as follows:
appId
objectId
canonicalKey
isLatchClosed
Billing system
Account
WM6308
false