1
Reply

Transactions using IEnlistmentNotification and Load balancing... any experiences?

Luc Veronneau

Luc Veronneau

13y
5.9k
0
Reply

    For some time now, i have been working on a generic transaction aware middleware that manages access to datasources that are not transaction aware. Up to now everything works fine assuming that all operations to target the same datasource arrive through the same machine / service. The client has specified that the infrastructure should support load balancing. My question is, what should be my approach to lock the thread and respect the order of calls between two or more machine that access the same resource in the background? My first idea was to leverage App Fabric caching to put the unique key of objects that are locked by a transaction, thus preventing other service from accessing the same resource at the same time. The problem with this solution is as follows: the threads / services that try to access that resource will listen for the item removal to try to access the resource again to lock it for themselves. That will, if i'm not mistaked, cause a race condition in which i cannot be sure that the first come first serve rule will apply.

    Any good ideas as to how to resolve this issue? (i'm really looking for design ideas, not necessarily code pieces)