For a while now I’ve been niggled by a quirk that I couldn’t understand the cause of. In one application, which uses a lot of local replicas and has been in use for many years, I occasionally had calls about documents that had “disappeared”. In each occasion I tracked them down as conflicts. But the strange symptom was that the $REF field – which gives the parent UNID – was the same as the document’s UNID. In effect, it was a response to itself. Various searches online never elicited a potential cause and I couldn’t see anything specific that explained it. At some point in the distant past I had even tried setting the Form property to “Merge/No Conflicts”.
Until this week, that is.
This week I happened to look at the modified initially date and time of each document. Obviously the modified in this file date and time would be the time it was added to the server replica and I didn’t expect this to be of relevance. Maybe this was what I had been looking at previously. But as soon as I compared the modified initially date and time on each, something immediately jumped out and the seemingly obvious explanation for symptom and cause promptly followed.
The first is the conflict that is a child of itself, the second conflict is the child of the first. Other examples all reinforced the same hypothesis – the cause is when a document is edited in two different local replicas at exactly the same time. Obviously when they come to the server, there is no “most recent” document, so no way to identify the “winner”. As a result, both became conflicts.
Historically there have been various fields that recalculate on every save. From years of troubleshooting Domino applications I’ve seen the profoud benefit of having the Seq Num property of each item, which corresponds to the nth save of the document. That corresponds to the programmatic call to NotesItem.lastModified (which gives a date). As a result, at some point I intend to review the application and find a way to avoid the relevant items being updated on every save. That should prevent the problem at source, because there will no longer be conflicts at item level, allowing them to be merged.