From e5d84e80b836ed0939e1546300d75fd93b637d8b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 31 Mar 2014 13:08:02 +0200 Subject: update Hibernate, JPA and mySQL libraries --- .../at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java | 7 ++++++- .../at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'id/server/moa-id-commons/src/main/java') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java index 0065f2242..76215528d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java @@ -29,6 +29,7 @@ import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; @@ -67,7 +68,11 @@ public final class MOASessionDBUtils { Logger.debug("Creating initial MOASession session factory..."); config.configure("hibernate_moasession.cfg.xml"); - serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); + //serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); + + serviceRegistry = new StandardServiceRegistryBuilder(). + applySettings(config.getProperties()).build(); + sessionFactory = config.buildSessionFactory(serviceRegistry); Logger.debug("Initial MOASession session factory successfully created."); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java index fac653eb2..eac47f93f 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java @@ -29,6 +29,7 @@ import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; @@ -67,7 +68,11 @@ public final class StatisticLogDBUtils { Logger.debug("Creating initial StatisicLogger session factory..."); config.configure("hibernate_statistic.cfg.xml"); - serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); + //serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); + + serviceRegistry = new StandardServiceRegistryBuilder(). + applySettings(config.getProperties()).build(); + sessionFactory = config.buildSessionFactory(serviceRegistry); Logger.debug("Initial StatisicLogger session factory successfully created."); -- cgit v1.2.3