
Hello all,
I'm in the process of developing a solution in Dynamics 365 Online (so I'm in the isolates mode) that will contain multiple business units. Each business unit will use the Case entity, however, they will have the case number generated differently. E.g. business unit A will only have incrementing number (1,2,3,4,5..n) and business unit B will have e.g.: DEP-1, DEP-2, DEP-n...
I would like to implement this using a non-coding approach and I had the real-time workflow in mind.
I know that a real-time workflow runs in stage 30 in the execution pipeline (which makes the real-time workflow part of a transaction) and it's also possible to create a plugin that runs in stage 20, to also be part of a transaction.
However, reading up on various blogs (without testing myself) I can see, that even though that the workflow and the plugins would run in a transaction, there would still be scenarios where I could have race conditions where cases might get the same Case numbers, and that I would have to implement .NET Mutex magic in plugins as a work-around.
Is this really true? Coming from a database background, I do not understand, that I would have race conditions when the a workflow/plugins runs in, and manipulates entities in a transaction.
Can someone explain it to me?