I have a situation in which multiple documents can be released by Quick Fields Agent into the repository at about the same time. As each document is released, it triggers a workflow that (among other things) copies pages from the released document to another document. Sometimes several of these dropped files will copy pages to the same document.
My question is, do I have to worry about concurrency or will Workflow take care of things automatically.
I can think of several ways Workflow could handle the situation of a workflow that tries to copy pages into a document while another workflow is already copying pages to the same document.
- (The best situation I can think of) The second workflow detects that it can't proceed due to a lock on the first document, and automatically waits for the lock to be released, then proceeds.
- The second workflow could detect a lock and terminate the workflow with an exception.
- The pages from the two workflows could end up being interleaved--if the copy of each page was treated as an atomic operation.
- (I trust Laserfiche wouldn't purposely do anything this bad) The document could become corrupted and unusable.
Does anyone know what really happens in this scenario? Unlike some things I do, timing situations are difficult to predictably test.