How to track vaadin session timeout

Hi

I developed a vaadin application which has an external session along with vaadin session. Now the requirement is I have to close the vaadin session when the external session becomes invalid but we do not know when the external session becomes invalid. So is there any method in which vaadin validates its session status so that i can override it and use that method to check the status of the external session.

Thank you.

Hi Amar.

but we do not know when the external session becomes invalid
so you don’t know what to check for

use that method to check the status of the external session
and you would like a hook to execute code that you cannot write because you don’t know what to check for?

I can check for that hook, but … I think you should also consider re-thinking the original problem?

https://vaadin.com/api/com/vaadin/server/WrappedSession.html
or one of its sub-classes could help in finding whether the underlying session has times out.

https://vaadin.com/api/com/vaadin/server/VaadinSession.html#close()
can be used to close the Vaadin session.

Hope it helps?

Best,
–Enver

Hi Enver

We know how to check the status of the external session but dont know when it expires. Everytime the external session staus is validated to true then it is kept alive .So I have to check the status every time a server request happens. I tried putting it in the service method of vaadinservlet but checking the status needs a Database call which is effecting the performance of the app especially when using spreadsheet.

So is there a way to do it effectively.

I am still not sure I understand correctly. You seem to want to check for the validity of the ‘external’ session every time Vaadin checks for the validity of the Vaadin session. Yet, AFAIK (not a Framework core developer but…) Vaadin checks for session validity at least at every server request. So would that not be
at least as
in
efficient
to check for your session’s validity then?

Maybe this thread helps - standard Java servlet API to get notified when your session dies rather than polling its state (nothing to do with Vaadin though):
https://vaadin.com/forum#!/thread/2428580

And if you really want to hook into Vaadin Lifecycle’s session destruction please have a look here:
https://vaadin.com/book/-/page/application.lifecycle.html

Helps?

Problem is that the external session is a wrapped oracle apps session. I will try to unwrap it see what i can do.

Thank you