I have a long running TransactionScope
in C#. I told the scope that it should have a long timespan, but still I get a timeout. What could cause this?
TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted;
transactionOptions.Timeout = TimeSpan.MaxValue;
using (var ts = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
{
DoLongCode();
}
TransactionScope
? I would be getting extremely anxious if I had aTransactionScope
that lasted more than a couple of seconds. Long-running transactions can severely impact all other callers... You also need to consider the commit/rollback cost; on many platforms, it is "rollback" that pays a penalty (commit being cheap); if this has done a lot of work in the 10 minutes, the rollback could be a killer. – Plasm