views:

89

answers:

1

I'm having a problem with a transaction in linq-to-sql timing out after 30 seconds.

Setting the CommandTimeout property on the DataContext does not seem to change the timeout.

The error message I get is:

"Timeout Expired. The timeout period elapsed prior to the completion of the operation or the server is not responding"

Queries that take less than 30 seconds work fine. only when the transaction takes > 30 seconds does the error pop up.

According to the documentation the CommandTimeout property value is obtained by the datasource - can this value be defined in SQL Server Management Studio?

Thanks

+1  A: 

Looks like it was a different problem all-togeather, I was using a second DataContext* inside of my transaction and I guess it was causing a lock on one of the tables - as the query (a simple select) wasn't returning from sql server - which was the cause of the timeout.

*I didn't actually mean to do that.

JSmyth