Saturday, 28 September 2013

Single thread per request asp.net

Single thread per request asp.net

Is anyone aware of any setting in IIS 7 that will force it to use a single
thread per request, and not allow it to switch threads during a request?
Or go back to a legacy thread model?
Our problem is the entire request, beginning to end uses multiple
connections to different databases and we want to guarantee data integrity
by using TransactionScope (which starts as a light weight transaction,
then is promoted to a distributed transaction, once a second connection is
established).
The reason we need a single thread per request, is when you attempt to
dispose a transaction on a thread different than the thread that started
it, it throws an exception stating it must be disposed on the same thread
that started it. Then the transaction leaks, and nothing gets committed,
and it slowly brings the machine to a grinding halt.

No comments:

Post a Comment