Joined: Wed Jul 21, 2004 5:37 pm Posts: 1 Location: Edmonton, Alberta, Canada
|
Hello,
I'm having some trouble figuring out how to prevent a thread leak that occurs when I hot deploy my application. I noticed that every couple dozen hot deploys I was running out of process space on my Linux box (OutOfMemoryError/unable to create native thread). Bad Thing. So, I attached a thread profiler to my appserver (Orion 2.0.2) and noticed that I was adding duplicates to a list of threads that appears to manage the second-level cache (Store <entityname> Expiry and Spool threads). Am I missing something in my usage of Hibernate (you know, like terminating these threads!)? I am accessing the session factory from a stateless session bean through a singleton that holds the session factory. I assume that I need to call SessionFactory.close() at some point but I'm not sure how to make that happen: the hot deploy process seems to preclude using finalize() for this.
Any ideas?
Thanks,
Greg
|
|