On 1/31/06, Blair Cooper <[EMAIL PROTECTED]> wrote: > The following code generates an exception when getId() is called with > Tomcat 5.5.15. In 5.5.7 it returned the session id. > > I realize that the session is being invalidated, thus valueUnbound() > being > called. I also realize that the servlet spec/errata says that this > exception should be thrown when the session is invalid. I would contend > that; at the time valueUnbound() is called the session should still be > considered valid.
valueUnbond is called after the session has been invalidated. > In our code we need to know which session is being invalidated in order > to > do some cleanup. Any chance that Tomcat would be changed/fixed to not > mark > the session as invalid until it has finished notifying the > HttpSessionBindingListeners? No (it was the same timing before, but Session.getId didn't throw an exception), but I agree the change was a very bad decision. Hacking Tomcat to remove the if (valid) is Session.getId is the way to go. Other workaround: get the session id in valueBound and store it in a field of your object. -- xxxxxxxxxxxxxxxxxxxxxxxxx Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL xxxxxxxxxxxxxxxxxxxxxxxxx --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]