Agent to delete Replication or Save Conflict documents

Hi,

I’m trying to create an agent that will go into a view and remove all the Replication or Save Conflict documents (but keep the latest version).

Any suggestions on how I would approach this? Any ideas would be much appreciate.

WC

Subject: Agent to delete Replication or Save Conflict documents

Here’s what I use. No logic to it – it just deletes replication/save conflicts.

SELECT @IsAvailable($Conflict);

@DeleteDocument

Subject: RE: Agent to delete Replication or Save Conflict documents

Well if you blindly delete the conflict documents you might loose some vital data/ information that might be there in one of the conflict document.Better approach is to study all the conflict documents manually and then decide on which one is the one having the required correct information/ data, make that as the main document by saving it and then delete all the rest of the documents.

But this is a tedious process and requires a lot of patience and time obviously.

If you really want to write an agent to this

  1. get the collection of all the conflict documents as well as the main document

  2. Get the document in this collection which is the latest ( using the last modified date and time )

  3. Make this document as the main document

  4. Delete all the rest of the documents in the collection.

As a side note consider changing the desing a bit to ensure that not many replication/ save conflicts occur. Document locking using an administrative server may be a good option.

Hope this helps.

Regards,

Nitin