New Posts New Posts RSS Feed: How can I set the default timeout, so as to apply to all RdbQuery's?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How can I set the default timeout, so as to apply to all RdbQuery's?

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: How can I set the default timeout, so as to apply to all RdbQuery's?
    Posted: 12-Jul-2007 at 1:10pm
From DevForce help on the CommandTimout property fo the EntityQuery class:
 
>A value of 0 indicates that the default timeout should be used.
 
How can I set the default timeout, so as to apply to all RdbQuery's?


Edited by IdeaBlade - 12-Jul-2007 at 1:11pm
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 1:11pm
I have looked into your question and found out that there is a default timeout value for the DbCommand class that the providers that we use (e. g. OleDb, SqlClient, etc.) inherit from.  This value is 30 seconds.  From what you said I inferred that you would like to be able to set a timeout value that would apply to all RdbQueries/EntityQueries.  Am I correct in what I am thinking?  If so, I am told there is currently no way to do this.  If you would like I can submit a feature enhancment request for this.  Please let me know if I am correct in what I am thinking and that this is what you would like.
Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 1:12pm
Yes, this is what I am asking, if there is a way to set a timeout value that would apply to all RdbQueries/EntityQueries.
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 1:13pm
Our chief architect suggested that a CommandTimeout value could be globally set by listening for the PersistenceManager Fetching event.  Sample code declaring the event delegate, listening for it, and setting the query Timeout value within the event handler follows:
 
     PersistenceManager mPm = PersistenceManager.DefaultManager;
      mPm.Fetching += new System.EventHandler<EntityFetchingEventArgs>(mPm_Fetching);
   .
   .
   .

   private static void mPm_Fetching(object sender, EntityFetchingEventArgs e) {
      if (e.Query.GetType() == typeof(EntityQuery)) {
        e.Query.CommandTimeout = 1;
      }
     }
 
Hope this helps.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down