[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[jetty-dev] Removing an attribute before persisiting the session via HttpSessionActivationListener
- From: Eirik Bjørsnøs <eirbjo@xxxxxxxxx>
- Date: Thu, 29 Jul 2010 15:17:57 +0200
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eLrK2QtC8HQ0wZi6kZslGyNicGymuPbGU2NZH06TXqcbtxHl3Dg+5K+bJeEWeJMxob hSC7uVm04OMgQIZ0YVqrRsLVY4kFYqamoGqLZWq2p2spuWXtT9SoutRdiA/T3GFo51eu GarQO8/yptMLJsUdq1gsgDe34A8A8Z67QMOXU=
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..