This SqlTransaction is complete; it is no longer used

I am using Linq for SQL with SQL Server 2008 SP2, my WinForm.net 4 application I am importing 200,000 records into SQL Server. I create objects and attach them to the datacontext on "insertonsubmit". Then I do "submitChanges" every 100 entries. I DO NOT HAVE ANY OPERATION that's always the case.

I get this error

 "This SqlTransaction has completed; it is no longer usable." with stack
at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Rollback()
   at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
   at System.Data.Linq.DataContext.SubmitChanges()

In blue. This error is incompatible; it may appear after 10,000 entries or 27,200 entries or XXX entries.

Since the error seems random, I thought it had something to do with garbage collection ...

Who has a key?

+5
source share
1 answer

SubmitChanges . , - . 200 . SqlBulkCopy , SPROC, 200k ; , /SPROC .

SqlBulkCopy - TDS, - - - (, , , ).

+2

All Articles