Concurrent Change - Validation Error

Problem

We have set up a system which sends updates over SOAP calls  to MDM & I have been building Data Stewardship Apps. When saving records in the apps, I am getting a message saying:

A more recent version of this record exists in hub - concurrent change.

 

Solution

This situation happens in the following scenario:

  • User 1 checks out a record R1 that had a BATCHID of 100 in his basket for update.
  • User 2 does the same (Note that User 2 can be an external job). So now User 2 has the same record R1 with the same BATCHID.
  • User 2 updates the record and submits it to the platform. The platform integrates this record and assigns it a BATCHID = 101 (greater than the previous BATCHID)
  • User 1 updates the record and tries to Submit it to the platform
  • User 1 receives a message that someone else updated the record (simply because the record he is updating has BATCHID 100 and therefore is not the same as the one actually in the MDM with BATCHID 101!)


So this is normal and it is used for concurrent change notification.
Note that User 1 has the opportunity to view the changes made by the other user and select which fields to update from R1 as of BATCHID 101

 ** When the app is objecting about the conflict, MDM is comparing columns SD_XXX.ORIGINALBATCHID for the current B_LOADID to the column of MD_XXX.B_BATCHID for the same PK and same Publisher.

Useful queries:

  1. Which records are checked out by a load process which has not completed:
    select *
    from SD_TABLENAME
    where B_LOADID not in (select B_LOADID from DL_BATCH)
    and <<RECORD_PK>> = :RECORD_PK_I_AM_LOOKING_FOR