[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Removing an attribute before persisiting the session via HttpSessionActivationListener


Hi,

I have some nice-to-have attributes in the user session which I don't want persisted. These attributes are either not serializable or they hold references to non-serializable attributes. So I need to remove them for session persistance to work.

I figured that implementing a listener that removes the attributes on HttpSessionActivationListener.sessionWillPassivate should work.

But in HashSessionManager.doStop() (around line 100), sessions seem to be serialized to disk *before* any listeners are triggered.

Does this mean I'm out of luck? Is the behaviour by design, or could it be solved?

I wouldn't expect this use case to be very uncommon, so my initial reaction was that it's probably me missing something here..

Thanks,
Eirik.