There is however a timeout value defined in the XPages client side runtime environment, that prevents event code from running too long (the default limit is about 6 seconds).
Actually, the code execution itself is not interrupted, but if a piece of code exceeds the maximum execution duration, the browser displays a timeout alert message to indicate that a Dojo Ajax call did not return a result within the allowed period of time.
To increase the timeout value, simply add the following script block to the source code of an XPage:
//increase Ajax request timeout to 600 seconds
XSP.submitLatency = 600 * 1000;