| Author |
java.lang.IllegalStateException: invalidate: Session already invalidated
|
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
|
|
Hello,
I am getting following error:
I am opening two sessions at a time
but before this newSession I already have opened session as following:
this session is closed at the end when all tasks are done that throws the aforementioned stackTrace. I stuck that using newSession.invlidate() why session instance is also invalidating?
Thanks in anticipation
|
 |
Dhaval J. Patel
Ranch Hand
Joined: Mar 10, 2011
Posts: 89
|
|
|
req.getSession(true) does not create a new session. It will create a new session only if there is no existing session. So in your case when you do req.getSession(true) it will return a reference to the same session you had before. If you invalidate that session and then try to do stuff with the same session, it wont work. It might be a different reference to the session, but still it is pointing the session that was just invalidated.
|
 |
 |
|
|
subject: java.lang.IllegalStateException: invalidate: Session already invalidated
|
|
|