Does anyone know ... when the web server times out a session I'm assuming all instances created by that session end up being garbage collected at some point - right? And when that happens the finally method gets called for each instance - right?
I have a static list containing locked projects (i.e. locked for edit in some browser somewhere) and if someone gets up and walks away I need to release that lock (in the finally method right now).
Also note that the objects may have another reference somewhere - possibly in a collection - thus preventing them from ever being GCed. So - like Bear said - use one of the listener interfaces to ensure correct handling. For example, have the object that holds the lock implement HttpSessionBindingListener, then the valueUnbound method is guaranteed to be called when the session is invalidated. Bill