Vaadin 7.1 releasing resources.

Hi.

I’m having some issues with my application in Vaadin 7.1.8 regarding releasing resources and closing the session.

I have a detach Listener registered in the UI class, but is not always called when the window or tab is closed without closing the session through my logout button.

For testing purposes, the heartbeatInterval is set to 5 seconds and the session-timeout to 2 minutes. As expected the session is closed by the server after a couple of minutes when the browser is closed, even though there are no more sessions pulling “heartBeats” to the server, and my detach listener is called.

But the problem comes when I enable push capabilities in my app. The detach listener is not always called, in fact it gets called very few times. And I have no way to release resources or stop threads.

After reading some posts in the forum, it seems to be a problem related with push. But It seems that the heartBeat stuff is still working, because once the browser or tab is closed the server doesn’t get more heartbeat events in the HeartbeatHandlers registered (I registered a custom one to verify this).

According to
this
, the ui expires after three consecutive heartbeats are missed, so why does enabling Push broke the closing session logic? Has someone found a way around this problem, that doesn’t imply disabling Push?

Thanks!

Hello.

At the end, I had to use Refresher instead, because I’m experiencing the same behaviour described
here
.
With
Refresher
, the session gets closed when the browser or tab is closed once the timeout is reached, just as expected and I’m not experiencing the buggy behaviour described above. It turned out to be a very good addon that suits my needs very well.