views:

55

answers:

1

I'd like to execute a task in parallel where each thread needs to have DB access but if one thread fails the transactions in all threads will fail.

You can assume that the transaction is active before the threads are created and that it's committed after they complete.

I'm also using a TransactionScope under the System.Transactions namespace.

A: 

You're probably looking for DependentTransaction -- just pass one of these to each of your consuming threads.

Travis Gockel