Reputation: 41
Our Java 8 and Spring-based application is generating bulk reports (PDF files) in the background. This might take more than one to two hours. The progress as a percentage value has been updated in the UI (front end) after generating each report, so the UI is active till completing the reports generation, but for some reason we're getting Session Expired messages in the UI from Vaadin framework in the middle of the report generation process.
Vaadin framework version : 7.6.2
Web Server : Tomcat 7
Value for heartbeat duration : default value (no explicit value configured)
Value for session timeout duration in web.xml : 30 min by default
No change for the value for closeIdleSessions (By default closeIdleSessions=false)
Can anyone please help to find the reason?
Upvotes: 4
Views: 589
Reputation: 8001
If the only activity is through pushing out status updates through the @Push
websocket, then that might not be enough to postpone session expiration on the servlet level.
You could work around this by ensuring there is a normal request from the client every now and then just to reset the session timeout. This can be done by enabling UI polling with a long interval, e.g. ui.setPollInterval((int) Duration.ofMinutes(25).toMillis());
.
Remember to disable the polling after the long task is done, or it will continue to keep your session alive.
Upvotes: 2