Setting Timeout in Entity Model

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
TonyV
Posts: 74
Joined: Wed 25 May 2011 15:03

Setting Timeout in Entity Model

Post by 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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by 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.

Post Reply