I have a problem with the following exception:
The transaction associated with the current connection has been completed but has not been liquidated. The deal must be deleted before the connection can be used to execute SQL statements.
A "call" to the database takes 10 m 53 (verified without a transaction and successfully completed) and with a transaction it throws an exception after 10 m. Therefore, I am sure that this is not the code that creates the problem, but the transaction timeout limit.
I saw that many people struggled with this problem, but I tried all the possible solutions that I found, but still have not succeeded to get rid of this exception.
In the following code I use:
[...]
TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = IsolationLevel.Snapshot;
transactionOptions.Timeout = new TimeSpan( 0, 0, 30, 0, 0 );
using( var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions) )
{
foreach (var selector in GetDataContext().sp_GetChangedSelectors(changeSet))
{
}
scope.Complete( );
}
I added an expression
<system.transactions>
<machineSettings maxTimeout="02:00:00"/>
</system.transactions>
machine.config % WINDIR%\Microsoft.NET\Framework64\v4.0.30319\Config
( sql- ).
, . ?