473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Set application timeout to more than 3 minutes

I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:

in web.config:
<system.web>

<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="600"/>

In the page itself:

Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
size=4096;user id=sa;data source=OBANG;persist securi" & _
"ty info=False;initial catalog=YZA; Connect Timeout=600 "
Me.SqlSelectCommand1.CommandTimeout = 600
The page still times out after 3 min. Is there anything that I am
missing?

Thanks in advance.

Jan 2 '07 #1
7 9883
dadocsis wrote:
I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:

in web.config:
<system.web>

<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="600"/>

In the page itself:

Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
size=4096;user id=sa;data source=OBANG;persist securi" & _
"ty info=False;initial catalog=YZA; Connect Timeout=600 "
Me.SqlSelectCommand1.CommandTimeout = 600
The page still times out after 3 min. Is there anything that I am
missing?

Thanks in advance.
If memory serves me right, there is a connection timeout setting in
mssql thats in seconds; What is yours set to?

Joe (MCAD)
Jan 3 '07 #2
Hi,

Would you please post the detailed exception when the page times out? Try
to visit it on localhost so that you can see the detailed exception.

I think this might not be related to the sql query's time out settings.
Anyway, let's see the exception first.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 3 '07 #3
Sorry it took me so long to write back. Yesterday was hectic.

I didnt mention that I already set the SQL server query timeout to 600
sec.

Here is the detailed exception:

Server Error in '/YZA_Remote' Application.
--------------------------------------------------------------------------------

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
behavior) +45

System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(CommandBehavior
behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
YZA_Remote.OrderControl.InitGridData() +8219
YZA_Remote.OrderControl.btnFetchNewData_Click(Obje ct sender,
EventArgs e) +49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1273

Walter Wang [MSFT] wrote:
Hi,

Would you please post the detailed exception when the page times out? Try
to visit it on localhost so that you can see the detailed exception.

I think this might not be related to the sql query's time out settings.
Anyway, let's see the exception first.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 4 '07 #4
Hi,

Hope you're better now.

For page execution time out setting, it's only effective in Release mode:

#httpRuntime Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
executionTimeout Optional TimeSpan attribute.

Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation
element is False. To help to prevent shutting down the application while
you are debugging, do not set this time-out to a large value.

The default is "00:01:50" (110 seconds).Note

In the .NET Framework 1.0 and 1.1, the default is 90.
#############
From the exception and stack trace, it seems related to ADO.NET query timed
out. To confirm this issue is not related to ASP.NET, try to issue the
query in a WinForm or Console application. Normally you only need to set
the connection time out in the connection string and you set the command
time out in CommandTimeOut property. This should work as expected. Anyway,
let's first narrow down the issue to see if it's related to ASP.NET or not.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 5 '07 #5
Thanks 4 the response. Can I run the query in "Query analyzer?"

Walter Wang [MSFT] wrote:
Hi,

Hope you're better now.

For page execution time out setting, it's only effective in Release mode:

#httpRuntime Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
executionTimeout Optional TimeSpan attribute.

Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation
element is False. To help to prevent shutting down the application while
you are debugging, do not set this time-out to a large value.

The default is "00:01:50" (110 seconds).Note

In the .NET Framework 1.0 and 1.1, the default is 90.
#############
From the exception and stack trace, it seems related to ADO.NET query timed
out. To confirm this issue is not related to ASP.NET, try to issue the
query in a WinForm or Console application. Normally you only need to set
the connection time out in the connection string and you set the command
time out in CommandTimeOut property. This should work as expected. Anyway,
let's first narrow down the issue to see if it's related to ASP.NET or not.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 5 '07 #6
I suggest create a simple Console application and use the same database
access code in your web application to test it, this way we could know if
it's related to ASP.NET or not.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 5 '07 #7

Walter Wang [MSFT] wrote:
I suggest create a simple Console application and use the same database
access code in your web application to test it, this way we could know if
it's related to ASP.NET or not.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Sorry for the delayed response again. I am going to have to hold
off on this for a little while. I am not a programmer I just have a
little light programming experience with VB based languages. The
program was initially created by an experienced coder and due to $ my
company doesnt want to hire him again to fix this problem so this is
why I am stuck with it. The query comes from a complex stored
proceedure that is like 10 pages long! It will take me some time to
build a Console app. so I will have to hold off on this when I am not
so busy. Thanks for your time.

Jan 11 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: E Sullivan | last post by:
I am having a time out issue when multiple users are accessing the server. This time out does not happen all of the time. My understanding is that the time out value is actually set in two places....
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
1
by: Jeremy S. | last post by:
In application pools there are two property settings (amongst others): 1. Recycle Worker Process (in minutes) 2. Idle Timeout - shut down worker process after being idle for (in minutes). My...
0
by: Phinneas | last post by:
Howdy, I have multiple apps running on a pair of dual-processor Win2k IIS servers, neither of which are domain controllers. My users are experiencing fairly frequent (10-20 / day) "Server...
6
by: Chase | last post by:
I'm pretty new to asp.net and am having problems with my application timing out. I've written an application that loops through all of the information on an excel spreadsheet and does certain...
6
by: Mad Scientist Jr | last post by:
My asp.net pages sessions are timing out after 20 minutes, and when I asked my Web host about it they said due to the nature of a shared hosting environment they cannot allow for sessions to keep...
10
by: Atul Shukla | last post by:
Hi, How can I avoid application timeout? Generally a web application time out is 20 minutes, however, we can define this timeout in web.config to any number of minutes. After giving 500 minutes of...
9
by: antonyliu2002 | last post by:
By default, IIS is configured to timeout a session in 20 minutes, which can be changed through the IIS config window. I use InProc sessionState mode. I can also set the session timeout in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.