473,287 Members | 1,827 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,287 software developers and data experts.

System.Data.SqlClient "Timeout expired" causing ASP.net web application to automatically restart.

I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server
that is experiencing strange shutdown problems. We are using ASP.NET v1.1
and our application is written in VB.NET

Here's the scenario:

1. .NET Windows Client on a remote machine makes a web service call to
update tables on a Web Server running SQL Server 2000.
2. The Update is updating about 1000 - 3000 records doing simple update
statements like "Update transactions Set UpdateTime = '08/12/2003 04:30:00
PM' "
3. The SqlClient code is receiving the error message below:

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
The statement has been terminated. at
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery(HZRequest
request) in
C:\projects\dotnet\Fish.NET\HorizonBoss\Framework\ DataAccess\HZSqlFactory.vb
:line 359
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding.
The statement has been terminated.

4. I have all my code wrapped in Try/Catch blocks so I see where I catch the
Exception and write this out to a log file.
5. I have code in the Application_End section of the Global.asax and I see
where a different Thread ID comes along and ends my running application.

2004-08-12 16:35:33.70 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): SQL to execute: UPDATE
mplPatronBalanceUpdate SET DateBalanceLastUpdated = '8/12/2004 4:35:33 PM'
WHERE PatronID = '0857'
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery( HZRequest
request ): Timeout expired. The timeout period elapsed prior to completion
of the operation or the server is not responding.
The statement has been terminated. at
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery(HZRequest
request) in
C:\projects\dotnet\Fish.NET\HorizonBoss\Framework\ DataAccess\HZSqlFactory.vb
:line 359
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding.
The statement has been terminated.
2004-08-12 16:36:14.09 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Closing Database connection.
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): FINISH:
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Successfully updated latest Real-Time Balance
Information.
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Finish:
2004-08-12 16:36:14.09 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Results = True
2004-08-12 16:36:14.29 [Thread 6] {Warning}
HorizonBoss.MealPayLive.WebServices.Global.Applica tion_End( Object sender,
EventArgs e ): Web Service application is ending.
2004-08-12 16:36:14.29 [Thread 6] {Warning}
HorizonBoss.MealPayLive.WebServices.Global.Applica tion_End( Object sender,
EventArgs e ): No Errors caused the shutdown.

You can see from the Above log file where the Application_Ends on a
different Thread.

6. I also have code in the Application_Error section of the global.asax,
but this section of the code never gets hit.

7.. When the next Web Request comes in, I write out a History of all the
reasons why the Web Server last shutdown.

2004-08-12 16:14:30.40 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformation(
ProcessInfo currentInfo ): ProcessID: 3836StartTime: 8/9/2004 1:51:25
PMStatus: 1ShutdownReason: 0RequestCount: 0PeakMemoryUsage: 54596Millseconds
the Worker process has been running: 152Minutes the Worker process has been
running: 23Hours the Worker process has been running: 2
2004-08-12 16:14:30.40 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformationHistory(
): START:
2004-08-12 16:14:30.40 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformation(
ProcessInfo currentInfo ): ProcessID: 3836StartTime: 8/9/2004 1:51:25
PMStatus: 1ShutdownReason: 0RequestCount: 38PeakMemoryUsage:
54596Millseconds the Worker process has been running: 167Minutes the Worker
process has been running: 23Hours the Worker process has been running: 2
2004-08-12 16:14:30.40 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformationHistory(
): FINISH:

I write down the Shutdown Reason as 0. Which means unknown reason why the
web server shut itself down.

8. My database connection string looks as follows:

server=localhost;UID=MyUser;PWD=secret;database=Da tabaseName;pooling=false;c
onnection reset=false;connection lifetime=5;min pool size=1;max pool
size=10;connection timeout=120

I'm completely stumped as to what can be terminating my web application. I
have verified that I'm not touching the \bin folder of the web application
as I know that this causing web servers to restart themselves.

Any help is greatly appreciated.
Nov 18 '05 #1
2 4539
Chris,
Perhaps it is a setting in the machine.config file. Check under
<system.web> ...
<processModel.. There are many values here that can shutdown the aspnet_wp.

Also it is curious that your connection string sets pooling=false but sets
values used for pooling. I do not know if this would have any effect.

"Chris Langston" wrote:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server
that is experiencing strange shutdown problems. We are using ASP.NET v1.1
and our application is written in VB.NET

Here's the scenario:

1. .NET Windows Client on a remote machine makes a web service call to
update tables on a Web Server running SQL Server 2000.
2. The Update is updating about 1000 - 3000 records doing simple update
statements like "Update transactions Set UpdateTime = '08/12/2003 04:30:00
PM' "
3. The SqlClient code is receiving the error message below:

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
The statement has been terminated. at
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery(HZRequest
request) in
C:\projects\dotnet\Fish.NET\HorizonBoss\Framework\ DataAccess\HZSqlFactory.vb
:line 359
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding.
The statement has been terminated.

4. I have all my code wrapped in Try/Catch blocks so I see where I catch the
Exception and write this out to a log file.
5. I have code in the Application_End section of the Global.asax and I see
where a different Thread ID comes along and ends my running application.

2004-08-12 16:35:33.70 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): SQL to execute: UPDATE
mplPatronBalanceUpdate SET DateBalanceLastUpdated = '8/12/2004 4:35:33 PM'
WHERE PatronID = '0857'
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery( HZRequest
request ): Timeout expired. The timeout period elapsed prior to completion
of the operation or the server is not responding.
The statement has been terminated. at
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
HorizonBoss.Framework.DataAccess.HZSqlFactory.Exec uteNonQuery(HZRequest
request) in
C:\projects\dotnet\Fish.NET\HorizonBoss\Framework\ DataAccess\HZSqlFactory.vb
:line 359
2004-08-12 16:36:13.70 [Thread 9] {Error}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding.
The statement has been terminated.
2004-08-12 16:36:14.09 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): Closing Database connection.
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.BusinessObjects.Patrons.Pa tron.UpdateLatestBalanceIn
formation( DataSet currentBalances ): FINISH:
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Successfully updated latest Real-Time Balance
Information.
2004-08-12 16:36:14.09 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Finish:
2004-08-12 16:36:14.09 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.MealPayCentral WS.SendBalances( DataSet
currentBalances ): Results = True
2004-08-12 16:36:14.29 [Thread 6] {Warning}
HorizonBoss.MealPayLive.WebServices.Global.Applica tion_End( Object sender,
EventArgs e ): Web Service application is ending.
2004-08-12 16:36:14.29 [Thread 6] {Warning}
HorizonBoss.MealPayLive.WebServices.Global.Applica tion_End( Object sender,
EventArgs e ): No Errors caused the shutdown.

You can see from the Above log file where the Application_Ends on a
different Thread.

6. I also have code in the Application_Error section of the global.asax,
but this section of the code never gets hit.

7.. When the next Web Request comes in, I write out a History of all the
reasons why the Web Server last shutdown.

2004-08-12 16:14:30.40 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformation(
ProcessInfo currentInfo ): ProcessID: 3836StartTime: 8/9/2004 1:51:25
PMStatus: 1ShutdownReason: 0RequestCount: 0PeakMemoryUsage: 54596Millseconds
the Worker process has been running: 152Minutes the Worker process has been
running: 23Hours the Worker process has been running: 2
2004-08-12 16:14:30.40 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformationHistory(
): START:
2004-08-12 16:14:30.40 [Thread 9] {Info}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformation(
ProcessInfo currentInfo ): ProcessID: 3836StartTime: 8/9/2004 1:51:25
PMStatus: 1ShutdownReason: 0RequestCount: 38PeakMemoryUsage:
54596Millseconds the Worker process has been running: 167Minutes the Worker
process has been running: 23Hours the Worker process has been running: 2
2004-08-12 16:14:30.40 [Thread 9] {Verbose}
HorizonBoss.MealPayLive.WebServices.Global.WritePr ocessInformationHistory(
): FINISH:

I write down the Shutdown Reason as 0. Which means unknown reason why the
web server shut itself down.

8. My database connection string looks as follows:

server=localhost;UID=MyUser;PWD=secret;database=Da tabaseName;pooling=false;c
onnection reset=false;connection lifetime=5;min pool size=1;max pool
size=10;connection timeout=120

I'm completely stumped as to what can be terminating my web application. I
have verified that I'm not touching the \bin folder of the web application
as I know that this causing web servers to restart themselves.

Any help is greatly appreciated.

Nov 18 '05 #2
I have looked into the processModel configuration and I do not have
anything setup that would cause it to shutdown.

I discovered from my google research that the asp.net framework will
shutdown the aspnet_wp.exe if it determines that a Dead-Lock condition
has occurred; in this case, I don't see why this exception could be
determined to be a Dead-Lock condition unless the Framework is looking
at certain types of exceptions to detemine a "dead-lock" state.

I have experimented with both connection pooling or and off, but the net
result was the same. Whenever this Timeout exception occurs, so Thread
is coming along and terminating my Web Service.

Chris Langston
CL*******@horizon-boss.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

0
by: Vance Kessler | last post by:
Yes, yes, I know why are we using Crystal 7 under Windows 2003. Well we have to for now. We had a website that was working just fine under Windows 2000 then we re-staged the boxes upgraded to...
0
by: Sham Yemul | last post by:
Hello, We developed an application that has many data entry forms and data controls in Vb.net and Sql Server2000 as backend. For this application we created connection object on load event of...
3
by: Carpe Diem | last post by:
Hello I have an aspx page that loses Session("user") value after a few minutes even after I set <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config and wrote function...
2
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
1
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
3
by: Agnes | last post by:
My client said when he got "Timeout Expired", once he press the button. whole applciation is quit. I want to "produce the same error " in my development environment but don't know how to do ?...
1
by: ahmnasa | last post by:
I have a website that has been running for over 1 year now that has never had these issues. Its running MS SQL Server 2005 Express Edition and IIS6 ASP 3 coded. All running from one server. I...
1
by: anudu | last post by:
hi all, I am developing a system using asp.net(c#). I am using "left" "top" & "Middle" design in my system. I want to set a time out mechanism. when the user has expired the configured time...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.