Timeout in LINQ to SQL inserting millions of records

Posted by Bas on Stack Overflow See other posts from Stack Overflow or by Bas
Published on 2010-05-03T11:13:18Z Indexed on 2010/05/03 11:28 UTC
Read the original article Hit count: 245

Filed under:
|
|
|
|

I'm inserting approximently 3 million records in a database using this solution. Eventually when the application has been inserting records for a while (my last run lasted around 4 hours), it gives a timeout with the following SqlException:

"SqlExcepetion: Timeout expired. The timeoutperiod elapsed prior to completion of the operation or the server is not responding."

What's the best way to handle this exception? Is there a way to prevent this from happening or should I catch the exception?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about timeout