aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java
diff options
context:
space:
mode:
authorITSERVICES\rb7147 <rb7147@att.com>2017-04-25 11:46:00 -0400
committerITSERVICES\rb7147 <rb7147@att.com>2017-05-03 09:58:17 -0400
commite0addf5b588a1244f9679becd90999dfcb4c3a94 (patch)
tree1212772d6366730266ff0e093c874b07aa716c29 /ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java
parent39fb0f30472777e4b60d6a7ac8aa4eb9773961ff (diff)
Policy 1707 commit to LF
Change-Id: Ibe6f01d92f9a434c040abb05d5386e89d675ae65 Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java')
-rw-r--r--ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java12
1 files changed, 9 insertions, 3 deletions
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 17babfa2e..4d872c32c 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
@@ -25,12 +25,14 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
-
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
public class HibernateSession{
+
+ private static final Logger LOGGER = FlexLogger.getLogger(HibernateSession.class);
private static SessionFactory xacmlsessionFactory;
-
-
+
static {
try {
Configuration configuration= new Configuration();
@@ -45,14 +47,18 @@ public class HibernateSession{
configuration.setProperty("hibernate.c3p0.max_size", "200");
configuration.setProperty("hibernate.c3p0.timeout", "3600");
configuration.setProperty("hibernate.c3p0.idle_test_period", "3600");
+ configuration.setProperty("hibernate.cache.use.query_cache", "false");
+ configuration.setProperty("hibernate.cache.use_second_level_cache", "false");
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
xacmlsessionFactory = configuration.configure("/hibernate.cfg.xml").buildSessionFactory(builder.build());
} catch (Throwable ex) {
+ LOGGER.error("Exception Occured While Creating Hiberante Session Factory"+ex);
throw new ExceptionInInitializerError(ex);
}
}
+
public static Session getSessionFactory() throws HibernateException {
return xacmlsessionFactory.openSession();
}