1 2 23 24 package net.fenyo.gnetwatch; 25 26 import java.io.*; 27 28 29 import org.hibernate.*; 30 import org.hibernate.cfg.*; 31 32 import org.apache.commons.logging.*; 33 34 39 40 public class Synchro { 41 private static Log log = LogFactory.getLog(Synchro.class); 42 private final Config config; 43 44 50 public Synchro(final Config config) { 51 this.config = config; 52 53 final SessionFactory sessionFactory; 54 55 new Configuration().configure(new File("hibernate.cfg.xml")); 56 57 try { 58 sessionFactory = new Configuration().configure(new File("hibernate.cfg.xml")).buildSessionFactory(); 60 } catch (Throwable ex) { 61 System.err.println("Initial SessionFactory creation failed." + ex); 63 throw new ExceptionInInitializerError (ex); 64 } 65 final ThreadLocal session = new ThreadLocal (); 66 67 } 68 } 69 | Popular Tags |