I have an xpage for a document which has concurrencyMode="fail". If the document suffers a save conflict it shows the error message "Document has been saved by another user - Save has not been performed" but continues to refresh the elements on the page, based on the front-end selection, rather than the saved data. I have a field which flags if the document is current, if this is set to 'No' then the 'Delete' button becomes visible. If the document is not saved due to a save conflict, this button is still rendered.
The save conflict is caused by a back-end agent that runs post save, I have looked to see if there is a way for the agent to run without re-saving the document, but cannot find a way without changing the code dramatically.
I feel the best way to avoid this problem would be to capture the fact that the save conflict occured and stop all processing at that point, possibly reloading the page so that the user can see the values as they are on the saved document, rather than what is on the screen. But I'm unsure how to achieve this.
Set the concurrencyMode to exception
and add a try catch around the xsp save then you can detect if save conflict has occurred.