I also would like to know that.
+1...should the kssesion.dispose(..) be called on application shutdown?
It really depends on what you are doing. If you have one session and the session will be used by all the users from the application until the application is shutdown you must call it there. If you have multiple sessions that are transient in the time and can be recreated, before creating a new session you can call dispose.
The main idea behind the dispose method is to remove all the references that have the knowledge session to the domain objects and internal objects that are not needed anymore.
Beeing so, it doesn't look really good to have a single session for multiple users, as it would accumulate a lot of garbage over time...
1 of 1 people found this helpful
It really depends on your situation. Sometimes you need to have a single session and sometimes you can split your problem or the scope to have multiple sessions.