0

When a request is posted with large data , eventually it gets cancelled with an error

Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0

But after this error I am getting doubled results, like request was duplicated,

        IAsyncResult res = delCreateReport.BeginInvoke(null, null);

        Response.BufferOutput = true;//This property should be set to true to avoid some view state and response exceptions

            while (res.IsCompleted == false)
            {
                Response.Write(" ");
                Thread.Sleep(5000);
                Response.Output.Flush();

            }
            Response.Clear();
            delCreateReport.EndInvoke(res);

This is the content of the code, here we are using a delegate function for ASYNC trasfer of some data to a 3rd party application, for small data sets it excecutes well but when data is large , and processing time is around 5 minutes , the post request is getting cancelled with the above stated error,but the 3rd party application is listing duplicated data,Using internet explorer no duplication is observed but parser error is there for all, What could be the reaseon for this, I tried avoiding response.write() and update panels but the result is the same. this happens only in the production server its working fine in local while Debugging.Thanks in advance

Edit

Large data here means a greater date range or larger filter conditions for the data transfer, (for eg july 1 - 5 is a small data range july 1 - november 1) is large data, The data here is not data from page, it is fetched from our db and transfered to 3rd party app, I dont know whether view state have significant role, and another important thing noticed here is this exception is thrown while request responds, ie after the operation is completed , No sign of duplication is found when IE is used but chrome duplicates the data, but both of them produce the error.

Amarnath R Shenoy
  • 5,121
  • 8
  • 24
  • 32
  • Could you be more specific than 'large data' ? Perhaps viewstate chunking will solve your 'large data' problem... http://stackoverflow.com/questions/10413986/viewstate-chunking-in-asp-net – Paul Zahra Jul 25 '14 at 09:14
  • I will try this and get back with results . – Amarnath R Shenoy Jul 25 '14 at 09:27
  • 1
    How are you sending the data to the third party? e.g. HTTPWebRequest can reuse connections if you haven't closed the stream correctly... and potentially if it does reuse it then it may simply append onto it, the result looking like a duplicated request. – Paul Zahra Jul 25 '14 at 09:43
  • I tested it , Its working fine and closed properly – Amarnath R Shenoy Jul 25 '14 at 10:30
  • Are you using HTTPWebRequest async? I'd check that out... http://stackoverflow.com/questions/202481/how-to-use-httpwebrequest-net-asynchronously – Paul Zahra Jul 25 '14 at 10:34

0 Answers0