Fixed bug in HibernateUtil
git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@3902 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
f02ab0c58e
commit
7e06205d10
|
@ -442,7 +442,7 @@ Indexes: cat_pkey primary key btree (cat_id)]]></programlisting>
|
|||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="quickstart-playingwithcats">
|
||||
<sect1 id="quickstart-playingwithcats" revision="1">
|
||||
<title>Playing with cats</title>
|
||||
|
||||
<para>
|
||||
|
@ -486,14 +486,17 @@ import net.sf.hibernate.cfg.*;
|
|||
|
||||
public class HibernateUtil {
|
||||
|
||||
private static Log log = LogFactory.getLog(HibernateUtil.class);
|
||||
|
||||
private static final SessionFactory sessionFactory;
|
||||
|
||||
static {
|
||||
try {
|
||||
// Create the SessionFactory
|
||||
sessionFactory = new Configuration().configure().buildSessionFactory();
|
||||
} catch (HibernateException ex) {
|
||||
throw new RuntimeException("Configuration problem: " + ex.getMessage(), ex);
|
||||
} catch (Throwable ex) {
|
||||
log.error("Initial SessionFactory creation failed.", ex);
|
||||
throw new ExceptionInInitializerError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue