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

Discussion in 'ASP .Net' started by Chris Langston, Aug 12, 2004.

  1. 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(SqlException exception,
    TdsParserState state)
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, TdsParserState state)
    at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
    t stateObj)
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
    SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    bulkCopyHandler, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
    result)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at
    HorizonBoss.Framework.DataAccess.HZSqlFactory.ExecuteNonQuery(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.Patron.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.Patron.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.ExecuteNonQuery( 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(SqlException exception,
    TdsParserState state)
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, TdsParserState state)
    at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
    t stateObj)
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
    SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    bulkCopyHandler, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
    result)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at
    HorizonBoss.Framework.DataAccess.HZSqlFactory.ExecuteNonQuery(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.Patron.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.Patron.UpdateLatestBalanceIn
    formation( DataSet currentBalances ): Closing Database connection.
    2004-08-12 16:36:14.09 [Thread 9] {Info}
    HorizonBoss.MealPayLive.BusinessObjects.Patrons.Patron.UpdateLatestBalanceIn
    formation( DataSet currentBalances ): FINISH:
    2004-08-12 16:36:14.09 [Thread 9] {Info}
    HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    currentBalances ): Successfully updated latest Real-Time Balance
    Information.
    2004-08-12 16:36:14.09 [Thread 9] {Info}
    HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    currentBalances ): Finish:
    2004-08-12 16:36:14.09 [Thread 9] {Verbose}
    HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    currentBalances ): Results = True
    2004-08-12 16:36:14.29 [Thread 6] {Warning}
    HorizonBoss.MealPayLive.WebServices.Global.Application_End( Object sender,
    EventArgs e ): Web Service application is ending.
    2004-08-12 16:36:14.29 [Thread 6] {Warning}
    HorizonBoss.MealPayLive.WebServices.Global.Application_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.WriteProcessInformation(
    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.WriteProcessInformationHistory(
    ): START:
    2004-08-12 16:14:30.40 [Thread 9] {Info}
    HorizonBoss.MealPayLive.WebServices.Global.WriteProcessInformation(
    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.WriteProcessInformationHistory(
    ): 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=DatabaseName;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.
     
    Chris Langston, Aug 12, 2004
    #1
    1. Advertising

  2. RE: System.Data.SqlClient "Timeout expired" causing ASP.net web applic

    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(SqlException exception,
    > TdsParserState state)
    > at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    > exception, TdsParserState state)
    > at
    > System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
    > t stateObj)
    > at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
    > SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    > bulkCopyHandler, TdsParserStateObject stateObj)
    > at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
    > result)
    > at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    > at
    > HorizonBoss.Framework.DataAccess.HZSqlFactory.ExecuteNonQuery(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.Patron.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.Patron.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.ExecuteNonQuery( 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(SqlException exception,
    > TdsParserState state)
    > at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    > exception, TdsParserState state)
    > at
    > System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
    > t stateObj)
    > at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
    > SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    > bulkCopyHandler, TdsParserStateObject stateObj)
    > at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
    > result)
    > at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    > at
    > HorizonBoss.Framework.DataAccess.HZSqlFactory.ExecuteNonQuery(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.Patron.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.Patron.UpdateLatestBalanceIn
    > formation( DataSet currentBalances ): Closing Database connection.
    > 2004-08-12 16:36:14.09 [Thread 9] {Info}
    > HorizonBoss.MealPayLive.BusinessObjects.Patrons.Patron.UpdateLatestBalanceIn
    > formation( DataSet currentBalances ): FINISH:
    > 2004-08-12 16:36:14.09 [Thread 9] {Info}
    > HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    > currentBalances ): Successfully updated latest Real-Time Balance
    > Information.
    > 2004-08-12 16:36:14.09 [Thread 9] {Info}
    > HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    > currentBalances ): Finish:
    > 2004-08-12 16:36:14.09 [Thread 9] {Verbose}
    > HorizonBoss.MealPayLive.WebServices.MealPayCentralWS.SendBalances( DataSet
    > currentBalances ): Results = True
    > 2004-08-12 16:36:14.29 [Thread 6] {Warning}
    > HorizonBoss.MealPayLive.WebServices.Global.Application_End( Object sender,
    > EventArgs e ): Web Service application is ending.
    > 2004-08-12 16:36:14.29 [Thread 6] {Warning}
    > HorizonBoss.MealPayLive.WebServices.Global.Application_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.WriteProcessInformation(
    > 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.WriteProcessInformationHistory(
    > ): START:
    > 2004-08-12 16:14:30.40 [Thread 9] {Info}
    > HorizonBoss.MealPayLive.WebServices.Global.WriteProcessInformation(
    > 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.WriteProcessInformationHistory(
    > ): 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=DatabaseName;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.
    >
    >
    >
     
    =?Utf-8?B?VG9kZCBTZWliZXI=?=, Aug 13, 2004
    #2
    1. Advertising

  3. RE: System.Data.SqlClient "Timeout expired" causing ASP.net web applic

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Chris Langston, Aug 13, 2004
    #3
  4. Chris Langston

    evilla

    Joined:
    Sep 12, 2006
    Messages:
    1
    Incredible!

    I had the same problem, after long hours of research and debbuging, restarted IIS and now it works fine :O
     
    evilla, Sep 12, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hb
    Replies:
    3
    Views:
    5,058
  2. Karl Seguin
    Replies:
    1
    Views:
    5,606
    Arun M
    Sep 4, 2007
  3. Karl Seguin
    Replies:
    0
    Views:
    624
    Karl Seguin
    Apr 14, 2005
  4. Ersin Gençtürk
    Replies:
    1
    Views:
    7,285
    jmohanty2006
    Sep 25, 2007
  5. Chris Langston
    Replies:
    1
    Views:
    244
    Todd Seiber
    Aug 13, 2004
Loading...

Share This Page