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.  [ 5 posts ] 
Author Message
 Post subject: Closing session.
PostPosted: Thu Nov 11, 2004 7:05 pm 
Beginner
Beginner

Joined: Tue Nov 09, 2004 12:22 pm
Posts: 44
I'm using Hibernate syncrhonizer in a standalone application and I initialized the connection to the database with _RootDAO.initialize().

Should I close the session or anything else when shutting down the application ?

Anyway, once the application shut down, there is no more thread alive, that's I'm wondering if it is important.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 8:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I would suggest you call the close() method on the SessionFactory before you shutdown the application. Its always a good idea to cleanup resources (even though many Java developers never think about this aspect - maybe to much C++ in my past).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 10:53 am 
Beginner
Beginner

Joined: Tue Nov 09, 2004 12:22 pm
Posts: 44
Thank you for your answer.
Hibernate Synchronizer generated some dao files and all methods referring to the session are private or protected.
Should I change any of those methods present in the _BaseRootDAO file ?

I would like to know the cleanest way to do that.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 6:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The SessionFactory rather than the Session should be closed (Factory will close all connections to the database etc) you must be able to get to the factory in some way since the factory creates the Sessions.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 11:29 am 
Beginner
Beginner

Joined: Tue Nov 09, 2004 12:22 pm
Posts: 44
Thank you.


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

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.