0
votes

I am maintaining an XPage application that has started creating multiple replication or save conflict documents BEFORE the initial document is saved. How can this be happening and how can it be prevented?

Users create a Contract in XPages application and have not yet saved the document so no other user should be able to see it, but when they save anything from 3 to 10 duplicates are created. It also appears to happen at random, that is at random times for random users. When I go into the core Notes database I can see them in an example shown below.

enter image description here

Here is the only refernce to a document datasource I can find.

<xp:this.data>
   <xp:dominoDocument var="document1" formName="Contract"   computeWithForm="both">
      <xp:this.postSaveDocument>
          ...........
      </xp:this.postSaveDocument>
   </xp:dominoDocument>
</xp:this.data>
1
Show us some code - specifically your data sources as Paul mentions. - Per Henrik Lausten
@PerHenrikLausten. The code is quite extensive and I will have to find a few specific examples to post up. I am not from an XPages Notes background so please bear with me - AJF
@PerHenrikLausten. I have added the only datasource I can find - AJF
I think we are going to need more code for this. If the document is saving before the user clicks save then you have some code that is executing a save during some event, if that is the case I could see some situations where this could cause a problem. - Patrick Sawyer
@PatrickSawyer. Yes Patrick. I am no expert in XPages but i feel this one is a bit of a mystery - AJF

1 Answers

3
votes

The most typical way multiple save conflicts are created for new documents is if the XPage has multiple dominoDocument datasources on the page and using a Button of type Submit or using the Save Data Sources simple action.

If datasources do not have ignoreRequestParams="true", all data sources are editing the same document, regardless of any other properties defined for the individual datasources.

The Save Data Sources simple action, as its name implies, saves all datasources on the page. However, a button of type Submit will submit the form, which tells the server to also save all datasources, not necessarily restrict functionality to any SSJS defined in the event.