I have a database that has a view which contains documents that are “not processed” i.e. there (processedYN) field still has a value of “No”. What I am wanting to do is run a java agent and set these documents to “Yes” thereby removing them from my view and making them processed.
My problem is that when I am running my code like below:
It is throwing errors because I am removing a document from the view while the agent is running so when the agent gos for the next document it is losing its place and therefore throws an error…
I need to essentially make the agent loop through the documents in view whilst setting the processedYN field to Yes and not lose its position when it trys to get the next document.
I hope you understand what Im trying to do and any help would be appreciated.
use the view.IsAutoUpdate property (set to false when you start and true when your code has finished)
use a second lotus.domino.Document to assign your next document before you save the current one. e.g. nextDoc = getNextDocument(dataDoc), update dataDoc, dataDoc = nextDoc
(I think the first option is probably the cleanest
doh…what was i thinking…view.setAutoUpdate(false); is the best solution …mine will only work if doesn’t recycle which means it can only process a small volume of docs before it blows up. again…all i can say…what was i thinking…