Search This Blog

Saturday, August 31, 2013

Both documents become replication or save conflicts

Hi guys

Recently working on one application I noticed that when two users edit the same document in the same time and both users save their changes then you get TWO replication conflicts, instead of one regular document and one replication or save conflict.

That was quite unexpected behavior and though I found out the reason I still do not understand WHY it works like it works. Probably you may tell me...


So let's check a simple scenario of getting replication or save conflict:

1) Create a new database or use existing one
2) Get one simple form, one view and make an agent that does something like Field a := @now;
3) Create a new document, save it but do not close it
4) Switch to the view and run agent on the document you keep opened in another tab
5) Switch back to the open document and press Ctrl+S.
6) Say YES when Notes will ask you if you want to save your document as a replication or save conflict.

Now you have something like this and this is exactly what you may expect


Now let's see what happens if you add call Source.Document.Save(true, false) into the PostSave even of your form.

Do all those steps again and check what you get this time.
In my case (IBM Lotus Notes 8.5.3 FP2) I got this result:


Can you explain that? I cannot :-)




No comments:

Post a Comment