2

I'm working in a new C# project and need some help.

The system has some jobs scheduled using Quartz api and one them is not working anymore.

I try to execute the method manually and got this error

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

in this line (the catch{} is called):

TList<TbBooking> allBooks = DataRepository.TbBookingProvider.Find(bQuery);

the variable bQuery has a query with 4200 id's and some parameters like 1 month period, flags etc.

I checked the SQL Timeout settings and it's 10 min (default) but the message appears in few seconds after the code enter in the .Find() method (less than 2 minutes) but using the SQLMS the query is executed pretty quick.

I'm thinking about run the command sp_updatestats but I wanna see your suggestions first.

p.s. The project is using codesmith and this funcionality was working since 2010.

Damon
  • 3,004
  • 7
  • 24
  • 28
Leandro Brito
  • 334
  • 2
  • 13
  • Lacking an index on a huge table? (Has the query been running *slower* over time?) Or perhaps there is a lock being held elsewhere preventing the query from executing? (Is this a sudden issue for the same number of items?) Also, how is the performance when running the command *directly* in SSMS? (And what does the plan show.) – user2864740 Dec 11 '13 at 19:43
  • I suspected that the issue was some setting in my application because the query returned results less than 10 seconds. I change the defaultCommandTimeout. – Leandro Brito Dec 12 '13 at 13:31

1 Answers1

0

I used the sp_updatestats and it didn't work. I create a index for the column and didn't work too. So I found a propertie in ProviderBase class named defaultCommandTimeout set to 30 seconds. I change it in my app.config file to 120 and the query worked again.

Leandro Brito
  • 334
  • 2
  • 13