This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Platform: LS Version: 3.1.2486.16216 (Nightlies 2011.03.09), SQL Server 2008 R2, Win 7 SP1. I'm using a using (var ts = new TransactionScope()) to put a quite a bit of work in one big transaction. .Savechanges on a uow within this transaction fails with the exception below. Without the outer transaction scope, everything works fine. If i do a .SaveChanges() after each iteration in my "outer" loop (which still is within one unit of work), I still get the same error, but at semirandom times. It happens after n +- 5% iterations (e.g. between 950-1050 iterations). If I do "less work" (ie. change less data) in each iteration, the iteration count before failure increases. In other words: This only happens when a certain amount of data is manipulated. 10486 entities is loaded on the UOW context at the time of failure. Exception info: InvalidOperationException: "The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements." Stack trace: at System.Data.SqlClient.SqlInternalConnectionTds.CheckEnlistedTransactionBinding() Best regards, Bjørn |
|