i'm facing with a problem during the implementation of a workflow process with nservicebus, i use version 2.0.1329.2
and the workflow i'm trying to implement is quite simple:
I have a List of articles that need to be computed, the workflow starts with the first list published. After that the user can do other publish adding or deleting some articles from the original list. Every list has a code identifier.
I have implemented it using an orchestration service identified by the list's code. In the saga data there are also all references of the articles which the list is made of.
The issue is that: when user publish a list of articles while another publish of the same list is in progress there aren't any lock of the process state and in this way there are no concurrency control but the handler which will finish later will have its own data persisted.
for example:
- List with 10 articles to add arrive at time [t], the orchestration service loads saga data from database, modify it and store it at time [t + 5]
- List with 1 item to add arrive at time [t+1], the orchestration service loads saga data from database, modify it and store it at time [t+4]
at time [t+6] i should have 6 added elements but i get only 5 added elements ..
I think the behavior should be like this: the second message if related to the same list should find the process state locked until the first finishes.. Otherwise if related to another list should be parallel processed.
For this i'm wondering if orchestration services aren't properly made to support a workflow process implementation unless setting the number of worker threads to only one losing the parallel efficiency though.