LINQ to SQL timeout inserting millions of records

I enter about 3 million records into the database using this solution . In the end, when the application inserted records for a while (my last run lasted about 4 hours), it gives a timeout with the following SqlException:

"SqlExcepetion: The timeout has expired. The timeout before the operation or server has expired does not respond."

What is the best way to handle this exception? Is there a way to prevent this, or should I catch an exception?

Thanks in advance!

+3
source share
3 answers

, .

, TRYING Linq2SQL 3 - . ORM - , .

:

  • ( ). (: 600 15 );)

. , , - ETL , - 3- , , // , ;)

.

+10

SQL script ( ) .

L2SQL , .

+3

I think you should increase your team's CommandTimeout.

The solution can be found here.

+2
source

Source: https://habr.com/ru/post/1743806/


All Articles