Skip to main content

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

Eirik,

Hhhmm, I think that's a bug. We really should call willPassivate()
before the objects are written out. This will need some refactoring
of the AbstractSessionManager to accommodate the HashSessionManager's
doStop() behaviour. The listeners are actually called by
AbstractSessionManager.doStop() which removes each of the sessions and
then calls the willPassivate() - in that order.

Raise a bug and we'll roll up the sleeves and dig in there.

cheers
Jan

On 29/07/10 23:44, Jesse McConnell wrote:
off the cuff this seems like something you could log a ticket for in
bugs.eclipse.org/bugs under RT ->  Jetty

I suspect the listeners are to notify _after_ things have been put to
disk and altering that contract would be problematic, that being said
I don't see why we couldn't put something else there to make this
work...

lodging a bug/feature is the correct next step and a patch from you
implementing the behavior you desire would be even better :)

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx



2010/7/29 Eirik Bjørsnøs<eirbjo@xxxxxxxxx>:

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.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev

--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com


Back to the top