Technical Notes |
|
This technical note describes how to modify the Verastream connector method timeout property to address client timeouts.
When a client sends a request to a Verastream Host Integrator (VHI) Session Server, there is a default timeout of 30 seconds. If there is no response from the server within that time period, your client application may get the following error:
2820 Timed out while waiting for data.This error may also appear in a client WCP trace (as described in Technical Note 40007).
A client method timeout may occur if you have a very large procedure or any operation that takes longer than 30 seconds to complete, or (in version 5.5 or higher) if you have an event handler that takes a long time to complete. The underlying cause may be captured in the server log (see Technical Note 40032) or server model debug messages file (see Technical Note 10066).
To avoid this error, the client method timeout can be increased to exceed the model timeouts (navigation, operation, event handler, etc.).
The following two examples use the setMethodTimeout method to revise the default timeout.
For web projects created in Web Builder (version 5.5 or higher), you can rebuild your project with a different global timeout property as follows:
Alternatively, you can revise your client code directly by adding a setMethodTimeout method:
The timeout for this method is in milliseconds, so if you want to set it for five minutes, set it equal to 300000. Add this method in the code before the function call that you believe will take a long time, for example, before a procedure call.
You may want to reset the timeout method back to a smaller number after the procedure is complete if you think the rest of the calls you make to the server will have a quicker response time. If you want the timeout to persist for the entire client connection, then you can set setMethodTimeout at the beginning of the client code. The following is from the product Java API documentation:
public void setMethodTimeout(int timeout)throws ApptrieveExceptionSets the method timeout for a Host Integrator Server session.
Reasons for failure include: Server session has not been established.
Parameters:
timeout - int - The timeout period in milliseconds
Throws:
ApptrieveException - - if a Host Integrator server error occurs
See Also: getMethodTimeout()