Hi Kristian, I experienced similar problems between Tapestry versions (5.0.18 and 5.1) with exactly the same use case, I never took the time to dig more deeply though as I simply had to find a quick fix, which was to destroy / remove all ASO's explicitly... not elegant but efficient, and have had no problems since. I will glad to share the code if you can't find a workaround.
Cheers, Peter ----- Original Message ----- From: "Kristian Marinkovic" <kristian.marinko...@porsche.co.at> To: "Tapestry users" <users@tapestry.apache.org> Sent: Thursday, 4 June, 2009 08:57:39 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Tapestry 5.0.18 -> 5.1.0.5 Upgrade: Session IllegalStateException i already use the Tapestry Request service. But the RequestImpl wont create a new HttpSession even i tell it ;) i think it is a bug. maybe someone can take a look at it to verify it. the code and the problem: if the session has been set once it will never be cleared, thus ignoring the create parameter. and with create=true i will always get the old invalidated session. RequestImpl: public Session getSession(boolean create) { if (session == null) { HttpSession hsession = request.getSession(create); if (hsession != null) { session = new SessionImpl(hsession, analyzer); } } if (!create && session != null && session.isInvalidated()) return null; return session; } g,kris Joachim Van der Auwera <joac...@progs.be> 03.06.2009 15:34 Bitte antworten an "Tapestry users" <users@tapestry.apache.org> An Tapestry users <users@tapestry.apache.org> Kopie Thema Re: Tapestry 5.0.18 -> 5.1.0.5 Upgrade: Session IllegalStateException You should invalidate the session from the (injected) Request object (not the HTTPServletRequest). This does the necessary bookkeeping. Kind regards, Joachim Kristian Marinkovic wrote: > hi, > > using 5.0.18 it was able to invalidate a HttpSession (via the Request) > and then to create a new one to store a new object (subject). > > in 5.1.0.5 this changed because the Request will always cache the old > Tapestry Session object and not attempt to create a new Http Session > as long as the reference is not null although it is invalidated. > > Are there any workarounds? Why i'm doing this: if you're logged in > as XXX you can re-login as YYY if you want and have a new https > session. > > g, > kris > > used to work > public void setSubject(Subject subject) > { > Session session = request.getSession(false); > > // create a new session > if (session != null && !session.isInvalidated()) > { > session.invalidate(); > } > request.getSession(true); > > asoManager.set(Subject.class, subject); > } > -- Joachim Van der Auwera PROGS bvba, progs.be --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org