Setting Timeout in Entity Model

Setting Timeout in Entity Model

Postby TonyV » Thu 15 Dec 2011 21:25

I'v built an entity model for my database using Entity Developer. Everything is running great. However, the default command timeout property for my connection is the default of 30 seconds. This is fine for most of my operations, however, I have a couple of stored procedures that I've mapped to methods that can take a lot longer than 30 seconds to run.

1. Is there a way I can change the timeout for those operations without affecting other "normal" queries?

2. If I set the timeout to 0, will the code wait until the stored procedure finishes and never timeout?

Tony
TonyV
 
Posts: 74
Joined: Wed 25 May 2011 15:03

Postby Shalex » Tue 20 Dec 2011 11:42

Please set the "Default Command Timeout=0;" connection string parameter.

TonyV wrote:1. Is there a way I can change the timeout for those operations without affecting other "normal" queries?
The mentioned connection string parameter will affect all the queries.

TonyV wrote:2. If I set the timeout to 0, will the code wait until the stored procedure finishes and never timeout?
It will never timeout.

You can also control the timeout in your code by setting a public CommandTimeout property of ObjectContext.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL