tags:

views:

8

answers:

0

I am in the middle of converting our legacy application to an enterprise architecture using WCF. I am struggling with some instancing/concurrency issues. The application architecture that is required does not lend itself very well to the WCF options available using ConcurrencyMode & InstancingContextMode.

The behaviour needed is something like something like this this:

Assume the whole app can deal with 3 "datasets". Assume we have 20 Clients and each service call from the client is with a unique data signature(which implies one of the earlier mentioned 3 datasets). The behaviour required is this: If client B calls the service with data signature X and another client A is in the middle of its service call with the same data signature, then do not create an instance of the service class till Client A has finished. If Client C calls with the same signature, while Client B is waiting, then it joins the waiting queue and its service instance should be created only after Client B finishes processing.
If on the other hand Client B or C call with a different data signature ( compared to what Client A is processing) then new instances of the service can be instantiated without waiting for A to finish.

I having difficulty mapping the conventional WCF Instancing/Concurrency behaviour to this scenario. Any help will be greatly appreciated.