-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Best way to locate places to put session.close() in code?
PostPosted: Wed Sep 19, 2007 1:58 pm 
Newbie

Joined: Wed Sep 19, 2007 1:54 pm
Posts: 5
Location: Houston TX
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.