I have implemented TransactionScope in c# like the following way:
public void BeginTransaction()
{
//_isInstanceOwnTransaction = false;
//TG: Please replace null check with extension method.
if (CurrentTransaction == null)
{
TimeSpan transTime = new TimeSpan();
CurrentTransaction = new TransactionScope(TransactionScopeOption.RequiresNew, transTime);
_isInstanceOwnTransaction = true;
}
}
I have a situation in which 6 SPs are executed in a single transaction. I have already set CommandTimeOut for EACH SP to 30 Mins.
For a particular instance the SPs are taking the below mentioned time to execute:
SP 1 - 0.5 Min
SP 2 - 0.5 Min
SP 3 - 0.5 Min
SP 4 - 0.5 Min
SP 5 - 20 Min
But while executing the 6th SP - I got the following error:
The operation is not valid for the state of the transaction-"Transaction Timeout"
Can anyone help me get rid from this error?