I think this is an application-specific question.  When the application
server's underlying session expires, all your @Persisted fields become
null, as you say.  If the user continues, it's just as if a random, unknown
user arrived and attempted to start interacting with your application
somewhere deep inside. Presumably you need to gracefully direct them to the
start of your application, where you can (potentially authenticating them
first) start setting persistent state once more.

An alternative would be for you to use a different persistence strategy
other than 'session'. The wiki has an example of a cookie-based strategy
(link below). Another option would be some sort of database storage.  You
stick a key in the session or a cookie, and this is used to look up the
rest of the state, which is stored in something more long term, like a
database.

If the session expires, then when they re-authenticate, you can associate
the new session with the key they were using last time.


On 13 May 2013 06:24, Ben Titmarsh <ben.titma...@hotmail.co.uk> wrote:

> My application is heavily dependent on state using @Persist annotations.
>  If a user gets the application into a certain state, then their session
> becomes stale (i.e. they leave their computer for half an hour), what is
> the preferred approach for graceful recovery of the application now that
> the Persistent fields are null?
>

Reply via email to