Pages

Tuesday, January 4, 2011

Handling "timeout exceeded" error in an XPage with an Ajax partial page refresh

XSP.submitLatency is a property associated with the XPage which governs the amount of time a pratial refresh can take in XPages. Exceeding which you get the "timeout exceeded" error asking you to refresh the entire page or cancel.


One of the most irritating errors that I have encountered in xpages. I even felt helpless against these errors in many cases :(


Thank god i found this in the 8.5 developerworks forum.


The following is a method to over ride it.
XSP.submitLatency = 60000; //timeout limit increased to 60 seconds


Hope this saves developers from going through the ones I crossed.


:)

7 comments:

  1. Thanks a lot !
    Can I have something may be like an image pop-ing up and depicting that "values are being loaded" ? Please guide.

    ReplyDelete
  2. Yes you can have. When do you want to bring this "Values are being loaded..." popup?

    If its on a page load, then you can display this popup by default and have a script at the end of the page that that will hide or destroy the popup after the entire page is loaded properly.

    If you need that on a button click, well, you must have a partial refresh enabled on that button, display the popup using client side javascript and the oncomplete event of that button must contain code to destroy/hide the popup.

    Hope that helps

    ReplyDelete
  3. Hi there,

    I am still getting the timeout exceeded window even after increasing the latency to 60 seconds. And what gets me is its not a consistent error. Sometimes users get it, sometimes they don't. I guess better question to ask is what's really causing this issue? Also what would you recommend as a good fix for this. Thanks for your help in advance.

    Chay

    ReplyDelete
    Replies
    1. Hope you would have solved your issue. See if following helps you

      I understand that timeouts occur due to network issues as well. I have had XPages that work fine locally but would fail on a server due to this error. So bandwidth is a major factor.

      Again check for your page size. Dojo libraries have a hit on the page load time. if its more like say 50KB+ ... then you may have to optimize the page size. Like substituting images with colors etc

      Delete