Async Calls losing connection to .aspx page RRS feed

  • Question

  • User358460611 posted

    We have a webservice.  It calls a stored procedure on a DB2 database.  We call it using the BeginMethod/EndMethod as it is an older application.  The issue is on long running DB2 stored procedures, once done, will not display back on the .aspx page.  Now let me say that procedures that take 3,4,5 or even 6 minutes display back to the page, but the one that takes 13 minutes does not.  All our timeouts have been set to 40 minutes.

    The set up is .aspx calls functions in a DAL that calls the Web Service methods.  We use an Async Page to do the processing and redirect back to the calling page.

    I put some Writes to the Event Log and they ALL write the expected results. 

    I'm at a loss here on why this works for 1 second to 6 minute calculations, but not for the 13 minute one.  ANY and ALL help is appreciated.




    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    '//**G's Code

    AddHandler Me.PreRenderComplete, New EventHandler(AddressOf Page_PreRenderComplete)

    Page.AddOnPreRenderCompleteAsync(New BeginEventHandler(AddressOf BeginAsyncOperation), New EndEventHandler(AddressOf EndAsyncOperation))

    '//**G's Code End

    '//**K's Code

    'Dim wsVSPS As New VSPSDS.ShelfPriceSurveyDS

    ' AddHandler wsVSPS.calculateSurveyPassFailCompleted, New VSPSDS.calculateSurveyPassFailCompletedEventHandler(AddressOf wsVSPS_Complete)

    'wsVSPS.calculateSurveyPassFailAsync(Session("Survey ID"))

    '//**K's Code End

    End Sub

    Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As EventArgs)    

    Dim sEvent As String = "Async Operation"

    'The write to the log works fine as did the one in the EndAysnc Sub and with the expected results

            EventLog.WriteEntry(sEvent,"Now response.redirect back", EventLogEntryType.Information, 18010, CType(3, Short))

    'Anything dealing with the page doesn't not work.  Even a texbox.text=the results will not display.

            Response.Redirect("SurveyCalculations.aspx", False)

    End Sub

    Function BeginAsyncOperation(ByVal sender As Object, ByVal e As EventArgs, ByVal cb As AsyncCallback, ByVal state As Object) As IAsyncResult

    Dim dal As New ShelfPriceSurveyDAL

    EventLog.WriteEntry(sEvent,"Begin Async Call", EventLogEntryType.Information, 18001, CType(3, Short))

    Return dal.calculateSurveyPassFailAsync(Session("Survey ID"), cb, state)

    End Function


    Sub EndAsyncOperation(ByVal ar As IAsyncResult)

    Dim dal As New ShelfPriceSurveyDAL

    Dim strResults As String = "Fail"

    Dim sEvent As String = "Async Operation"

            strResults = dal.calculateSurveyPassFailAsyncEnd(ar)

            EventLog.WriteEntry(sEvent,"AysncCalculation.aspx received these results : " & strResults, EventLogEntryType.Information, 18009, CType(3, Short))

    If Left(strResults, 9) = "Completed" Then

                Session("SURVEYCALCREPLY") = "Survey calculations were completed successfully for survey : " & Session("Survey ID")

    ElseIf Left(strResults, 7) = "Working" Then

                Session("SURVEYCALCREPLY") = strResults


                Session("SURVEYCALCREPLY") = "An unknown error has occured. " & strResults & " Please contact the help desk."

    End If


    End Sub

    Tuesday, September 10, 2013 12:41 PM

All replies

  • User794904726 posted

    Hello pkloeb,

    Did you check the executionTimeout setting of httRuntime in your web.config file? Is this entry exist in your web.config? Are the timeouts of you WCF service and Web application are in sync? Ideally this should match as well. Below is an example which set the time of web reqeust to 15 minutes and this means if any request takes more than 15 mins the IIS will automatically timesout this reqeust and will not serve.

    <httpRuntime executionTimeout="900">

    Wednesday, September 11, 2013 2:11 AM
  • User358460611 posted

    Yes, we have the <httpRuntime executionTimeout="2400">  It's overkill, but just wanted to make sure.

    Got any other thoughts...we are at a loss around here.

    Many thanks,


    Wednesday, September 11, 2013 12:03 PM