<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Timeout calling Stored Procedure</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Timeout calling Stored Procedure</description>
  <pubDate>Tue, 28 Apr 2026 21:40:29 -700</pubDate>
  <lastBuildDate>Tue, 20 Oct 2009 19:07:36 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1523</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Timeout calling Stored Procedure : After setting spQuery.CommandTimeout...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5663#5663</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 1523<br /><strong>Posted:</strong> 20-Oct-2009 at 7:07pm<br /><br />After setting spQuery.CommandTimeout = 60, I ran my app again got thrown out with<br /><br />'IdeaBlade.Core.IdeaBladeException' occurred in IdeaBlade.EntityModel.dll<br />FetchStrategy for StoredProcQuery must be DatasourceOnly.<br /><br />I remember I read somewhere that StoredProcQuery is by default DataSourceOnly. Anyhow, I added spQuery.QueryStrategy = QueryStrategy.DataSourceOnly. Set a breakpoint before ExecuteQueryAsync, to see spQuery's FetchStrategy was indeed DataSourceOnly.<br /><br />Continue and still throws "FetchStrategy for StoredProcQuery must be DatasourceOnly".<br /><br />Only I went back to stored proc and removed WAITFOR DELAY '00:00:50', that the spQuery worked. This is really weird.<br /><br /><br /><br />]]>
   </description>
   <pubDate>Tue, 20 Oct 2009 19:07:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5663#5663</guid>
  </item> 
  <item>
   <title>Timeout calling Stored Procedure : That timeout exception is coming...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5661#5661</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1523<br /><strong>Posted:</strong> 20-Oct-2009 at 5:31pm<br /><br />That timeout exception is coming from the database.&nbsp; The query has a CommandTimeout property you can set to override the 30 second default, e.g., <DIV>&nbsp;</DIV><DIV><DIV></DIV><DIV></DIV><DIV></DIV>&nbsp;&nbsp; spQuery.CommandTimeout = 45;</DIV><DIV>&nbsp;</DIV><DIV>You can set this for either sync or async execution requests.</DIV><DIV>&nbsp;</DIV><DIV>All database access in DevForce WinClient is delegated to the Entity Framework.&nbsp; I'd guess that EF delegates to the ADO.NET provider in use concerning how the database commands are generated and issued.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 20 Oct 2009 17:31:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5661#5661</guid>
  </item> 
  <item>
   <title>Timeout calling Stored Procedure : I still got a timeout exception...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5645#5645</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 1523<br /><strong>Posted:</strong> 19-Oct-2009 at 2:44am<br /><br /><DIV></DIV>I still got a timeout exception in my async callback:<DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void DoTask()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StoredProcQuery spQuery = m_EntityManager.MySP(...);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Does not help, though reference&nbsp;help&nbsp;mentioned&nbsp;the default Timeout is 1 minute for UseDTCOption.True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //TransactionSettings txnSettings = new TransactionSettings(UseDTCOption.True);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //spQuery.QueryStrategy = new QueryStrategy(QueryStrategy.DataSourceOnly, txnSettings);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Guid id = Guid.NewGuid();</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_EntityManager.ExecuteQueryAsync(spQuery, new AsyncCompletedCallback&lt;EntityFetchedEventArgs&gt;(AsyncFetchCompleted), id);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private static void AsyncFetchCompleted(EntityFetchedEventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (e.Error != null)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#ff0000>throw e.Error; // timeout exception in InnerException<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV>You can easily simulate timeout by placing a delay &gt; 30seconds at the start of any SP:</DIV><DIV>&nbsp;</DIV><DIV>WAITFOR DELAY '00:00:50';</DIV><DIV>&nbsp;</DIV><DIV>Looks like EntityManager's ExecuteQueryAsync(...) is not implemented using Asynchronous SqlCommand, or am I wrong?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 19 Oct 2009 02:44:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5645#5645</guid>
  </item> 
  <item>
   <title>Timeout calling Stored Procedure : Under normal circumstances, SP...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5643#5643</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=370" rel="nofollow">sebma</a><br /><strong>Subject:</strong> 1523<br /><strong>Posted:</strong> 18-Oct-2009 at 7:16am<br /><br /><DIV></DIV>Under normal circumstances, SP queries would return results pretty fast, well within the default ADO.NET's SqlCommand 30 seconds timeout.<DIV>&nbsp;</DIV><DIV>This topic is not about database design,&nbsp;though this&nbsp;too has&nbsp;significant impact to application performance.</DIV><DIV>&nbsp;</DIV><DIV>We have&nbsp;bulk computation store procedures that are executed by background tasks on hourly basis, these SPs may exceed the default SqlCommand timeout. In such cases, we receive </DIV><DIV>&nbsp;</DIV><DIV><FONT face="Segoe UI"><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><FONT size=1 face="Segoe UI"><SPAN style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 9pt">IdeaBlade.EntityModel.EntityServerException: An error occurred while executing the command definition. See the inner exception for details. ---&gt; System.Data.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---&gt; System.Data.SqlClient.SqlException: Timeout expired.&nbsp; The timeout period elapsed prior to completion of the operation or the server is not responding.</SPAN></FONT></P></FONT></DIV><DIV>&nbsp;</DIV><DIV>Without deviating from facilities provided by DevForce (e.g. ADO.NET Asynchronous SqlCommand,&nbsp;Microsoft-specific&nbsp;T-SQL with Service Broker etc.), can we use EntityManager's ExecuteQueryAsync(...) to execute long-running SP asynchronously?</DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance.</DIV><DIV>Sebastian</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 18 Oct 2009 07:16:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1523&amp;PID=5643#5643</guid>
  </item> 
 </channel>
</rss>