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: when/where to call HibernateUtil.shutdown() in standalone
PostPosted: Thu Apr 26, 2007 12:04 am 
Newbie

Joined: Wed Apr 25, 2007 9:41 pm
Posts: 4
Hi,

I want to know, in standalone application, when/where to call HibernateUtil.shutdown(); in the localThread design mode:

<property name="current_session_context_class">thread</property>


My DAO layer is based on "Java Persistence with Hibernate"

----------
/**
* Closes the current SessionFactory and releases all resources.
* <p>
* The only other method that can be called on HibernateUtil
* after this one is rebuildSessionFactory(Configuration).
*/
public static void shutdown() {
log.debug("Shutting down Hibernate");
// Close caches and connection pools
getSessionFactory().close();

// Clear static variables
sessionFactory = null;
}
----

thanks


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.