Set application timeout to more than 3 minutes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dadocsis

    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 executionTimeou t="1000" maxRequestLengt h="2000000"/>
    <sessionState
    mode="InProc"
    stateConnection String="tcpip=1 27.0.0.1:42424"
    sqlConnectionSt ring="data
    source=127.0.0. 1;Trusted_Conne ction=yes"
    cookieless="fal se"
    timeout="600"/>

    In the page itself:

    Me.SqlConnectio n1.ConnectionSt ring = "workstatio n id=OBANG;packet
    size=4096;user id=sa;data source=OBANG;pe rsist securi" & _
    "ty info=False;init ial catalog=YZA; Connect Timeout=600 "
    Me.SqlSelectCom mand1.CommandTi meout = 600


    The page still times out after 3 min. Is there anything that I am
    missing?

    Thanks in advance.

  • Joe (MCAD)

    #2
    Re: Set application timeout to more than 3 minutes

    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 executionTimeou t="1000" maxRequestLengt h="2000000"/>
    <sessionState
    mode="InProc"
    stateConnection String="tcpip=1 27.0.0.1:42424"
    sqlConnectionSt ring="data
    source=127.0.0. 1;Trusted_Conne ction=yes"
    cookieless="fal se"
    timeout="600"/>
    >
    In the page itself:
    >
    Me.SqlConnectio n1.ConnectionSt ring = "workstatio n id=OBANG;packet
    size=4096;user id=sa;data source=OBANG;pe rsist securi" & _
    "ty info=False;init ial catalog=YZA; Connect Timeout=600 "
    Me.SqlSelectCom mand1.CommandTi meout = 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)

    Comment

    • Walter Wang [MSFT]

      #3
      RE: Set application timeout to more than 3 minutes

      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 (wawang@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support

      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Gain technical skills through documentation and training, earn certifications and connect with the community

      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.

      Comment

      • dadocsis

        #4
        Re: Set application timeout to more than 3 minutes

        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.Sql Client.SqlExcep tion: 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.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or
        cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
        System.Data.Sql Client.SqlComma nd.ExecuteReade r(CommandBehavi or
        behavior) +45

        System.Data.Sql Client.SqlComma nd.System.Data. IDbCommand.Exec uteReader(Comma ndBehavior
        behavior) +5
        System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
        startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
        CommandBehavior behavior) +304
        System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
        startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
        CommandBehavior behavior) +77
        System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet) +38
        YZA_Remote.Orde rControl.InitGr idData() +8219
        YZA_Remote.Orde rControl.btnFet chNewData_Click (Object sender,
        EventArgs e) +49
        System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

        System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
        eventArgument) +57
        System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
        sourceControl, String eventArgument) +18
        System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
        +33
        System.Web.UI.P age.ProcessRequ estMain() +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 (wawang@online. microsoft.com, remove 'online.')
        Microsoft Online Community Support
        >
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Gain technical skills through documentation and training, earn certifications and connect with the community

        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.

        Comment

        • Walter Wang [MSFT]

          #5
          Re: Set application timeout to more than 3 minutes

          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)

          executionTimeou t 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 (wawang@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.


          Comment

          • dadocsis

            #6
            Re: Set application timeout to more than 3 minutes

            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)

            executionTimeou t 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 (wawang@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.

            Comment

            • Walter Wang [MSFT]

              #7
              Re: Set application timeout to more than 3 minutes

              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 (wawang@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.

              Comment

              • dadocsis

                #8
                Re: Set application timeout to more than 3 minutes


                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 (wawang@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.

                Comment

                Working...