X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpap%2Fxacml%2Frest%2FHibernateSession.java;h=93fe337273911eeed35a18226d07456700fca4cf;hb=refs%2Fchanges%2F45%2F4445%2F4;hp=4d872c32cfae1d6af01dbde16340ede7a1eb02d4;hpb=7e547eaa55920dfbc9691eab33bb728395b50cf2;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java index 4d872c32c..93fe33727 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java @@ -20,7 +20,6 @@ package org.openecomp.policy.pap.xacml.rest; -import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; @@ -53,13 +52,12 @@ public class HibernateSession{ StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()); xacmlsessionFactory = configuration.configure("/hibernate.cfg.xml").buildSessionFactory(builder.build()); - } catch (Throwable ex) { + } catch (Exception ex) { LOGGER.error("Exception Occured While Creating Hiberante Session Factory"+ex); - throw new ExceptionInInitializerError(ex); } } - public static Session getSessionFactory() throws HibernateException { + public static Session getSessionFactory(){ return xacmlsessionFactory.openSession(); }