All,
I am the unfortunate heir to some legacy code which uses Hibernate. It is a fairly complex, multi-threaded SWT app. which does a ton of database access.
Fairly often, the console output will show a warning from org.hibernate.jdbd.ConnectionManager - "unclosed connection, forgot to call close() on your session?"
I realize that this is baaaaaad news, and I'd expect that enough of these occurrences will eventually cause the program to fail due to this memory leakage.
So I want to refactor the code to put in session.close anywhere that it may be missing.
My question is what is the most reliable way for me to identify sessions which have been opened so that I can ensure that the appropriate finally block is there to close them?
Thanks,
Wes
|