Question

I have a GWT 2.5 application with gxt 2.3.1 with which I made a RPC longer than 30 min. But before I got the response the application pop up a an Error windows With message 503 Service Temporarily message with all the usual details

The server itself in the meantime still processing the data so actually the server is available.

It's realy looks like a session time out but in the web.xml i set up a 1 day long timeout

    <!-- one day -->
    <session-config>
        <session-timeout>1440</session-timeout>
    </session-config>

And after the processing completed I do not got the response on the client side. So my second guess is the rpc time what I currently currently trying to find out how to set up without success so far.

Was it helpful?

Solution

You can use GWT Timer to keep connection active between server and client by just calling a RPC after an interval. RPC will do nothing other than keeping connection active.

You can cancel the timer once the long running task is completed or you can start it again before starting any task that takes more time.

Sample:

// Create a new timer that calls RPC that does nothing.
Timer t = new Timer() {
  @Override
  public void run() {
    //RPC Call 
  }
};

// Schedule the timer to run once in 5 seconds.
t.schedule(5000);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top