Concern in keeping values with application instance .

Hi All ,

I recently explore Vaadin for my new project . I have few concerns regarding pass objects across the application . Which is the best option to keep object which has to pass across the application . is it session or application instance ?

A session and an application instance is pretty much the same thing. Every time a new user enters the application, a new application instance is created, and that instance is kept alive until the user closes the application or the session times out.

Hi Jens ,

Thanks for reply , i got that point . If i use application instance to keep data , this will be there until the session expired , rite ? . That means the developer should taken care to remove unwanted data from the application instance after its usage.

If it is directly referenced in the application instance, then yes, it will be there until the session expires. However if there are no more reference from the application to the data, like the data is in a view that is not in any layout and not stored in a variable, then Java’s normal garbage collector will clean it up.

You seldom have that much data in an app that it would be a problem. I have never done any manual cleaning up of “unwanted data”. Session expiration will do all the cleaning that I need.

Hi Jens ,

Thank you .