Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why an invalid session can invoke its method

 
Napu Sun
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that an invalid session can invoke getServletContext() without problem. This makes me confusing what is an invalid session. Is an invalid session supposed to be collected by GC?

Thanks Guys.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The GC can't collect something that is still being referenced.

A session getting invalidated is like getting fired from your work. You haven't quite left the building (your context) yet, but you really aren't allowed to do any more work.
 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc,


This is a good example....really I mean it....now I can remeber this SessionInvalid concept without any problem.

Thanks
 
Napu Sun
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc, thank you again.

So an invalid session is still alive with the reference to the context, but it is not allowed to do his work any more.
 
Sandeep Krish
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool example Marc!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic