This is a migrated thread and some comments may be shown as answers.

ExecuteQuery timeout

1 Answer 123 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Remco
Top achievements
Rank 1
Remco asked on 15 Jan 2014, 05:10 PM
Hello,

i use this code in my application to execute a store procedure:

var bookings = DbContext.ExecuteQuery<UserCreditDebit>("SP_CalcUsersCreditDebit").ToList();

foreach
(UserCreditDebit booking in bookings)
{
....  do some stuff
}

this work normal very fine.. but if i have a lot of data i get a SQL Timeout error.

how can i change the timeout ?
i was found this answer  
http://www.telerik.com/community/forums/orm/development/how-to-set-commandtimeout-for-stored-procedures-called-as-a-domain-method.aspx

but i don't know how to apply this solution for my query that returns a list as result.

can somebody give me a hint how to solve this?

thanks

Remco

1 Answer, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 16 Jan 2014, 03:45 PM
Hi Remco,

Depending on your scenario you can either set the command timeout on a global level, or you can modify the call to your stored procedure in order to apply the approach described in the linked forum thread.

 If your scenario allows you to have a higher global command timeout you can set it by using the Model Settings dialog or specify it in the .config file of your project.

If you wish to specify the timeout only for the execution of specific stored procedures, you should modify the call to the stored procedures to use OACommands. Then you would be able to apply the approach described in this forum thread.

I hope this helps. Should you have additional questions feel free to post at our forums again or contact us via our Ticket System.

Regards,
Kristian Nikolov
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
Development (API, general questions)
Asked by
Remco
Top achievements
Rank 1
Answers by
Kristian Nikolov
Telerik team
Share this question
or