Last post Apr 17, 2018 04:11 AM by DA924
Apr 16, 2018 03:18 PM|naoufalBer|LINK
I have a code similar to this, which performs a commit of a single row to a database table (SQL 2008)
using (var db = new MyDbDataContext(_dbConnectionString))
Action action = new Action();
Normally everything is fine, but once in a while I get the following exception:
System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
There are a number of similar questions on SO but I after reading them I cannot work out the cause.
Could this be simply due to a SQL timeout (the exception occurs close to 30s after the call is made)?
Apr 17, 2018 04:11 AM|DA924|LINK
If I am not mistaken Link-2-SQL wraps things in a transaction and may be a shared connection issue is happening..
You can also post to the MSDN MS SQL Server forum to see what someone says there on the issue.