Hi, one of the possible variants is to execute each action in Transaction scope, for example:
Parallel.ForEach(MyIEnumerableSource, insertAction);
static void insertAction(EntityItem item)
{
using (TransactionScope scope = new TransactionScope(
Required, new TransactionOptions() {IsolationLevel = ReadCommitted))
{
try{
ExecuteInsertQuery(item);
scope.Complete ();
}
catch{scope.Rollback();}
}