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: Session that doesn't manage the connection not closed
PostPosted: Wed Aug 27, 2008 5:10 am 
Newbie

Joined: Tue Aug 26, 2008 12:05 pm
Posts: 1
I'm introducing progressively Hibernate in my system.
The system is a middleware that handles web service request.
For each request we get a connection from the pool and is them handed to the different DAOs to do their job with JDBC. The transaction is handled outside of the DAOs.

Now I'm introducing Hibernate so I create DAOs based on hibernate (working together with the existing ones), they receive a connection to create a session and then the different methods query or updates on that session.

Currently I'm not closing the sessions at all and it seems to work fine, since the connection and the transaction are managed outside Hibernate.
I think when the DAO is garbage collected the session and it's cache are too.

Are there any risks or memory leaks problems on doing this?

I've seen in the docs that the standard pattern is saving the session for each thread using a filter or similar but in my case that doesn't fit very well.


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.