aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-commons/src/main/java')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java14
2 files changed, 8 insertions, 8 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
index 8970a82aa..7a6efc5ac 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
@@ -27,7 +27,7 @@ public class ConfigurationDBRead {
List result;
EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
+
javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID"));
//query.setParameter("id", id+"%");
query.setParameter("id", id);
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
index bc6a0b922..dc0e493d1 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
@@ -8,7 +8,7 @@ import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.hibernate.HibernateException;
-import org.hibernate.Session;
+
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.logging.Logger;
@@ -18,7 +18,7 @@ public final class ConfigurationDBUtils {
private static EntityManagerFactory entitymanagerfactory;
@SuppressWarnings("rawtypes")
- private static final ThreadLocal THREAD_LOCAL = new ThreadLocal();
+ private static final ThreadLocal THREAD_LOCAL_CONFIG = new ThreadLocal();
private static boolean automaticSessionHandling = false;
protected ConfigurationDBUtils() { }
@@ -69,7 +69,7 @@ public final class ConfigurationDBUtils {
return entitymanagerfactory.createEntityManager();
}
- EntityManager session = (EntityManager) THREAD_LOCAL.get();
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
// Open a new Session, if this Thread has none yet
if (session == null) {
session = getNewSession();
@@ -84,7 +84,7 @@ public final class ConfigurationDBUtils {
//return sessionFactory.getCurrentSession();
return entitymanagerfactory.createEntityManager();
}
- EntityManager session = (EntityManager) THREAD_LOCAL.get();
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
if (session != null) {
Logger.warn("Previous session has not been closed; closing session now.");
closeSession();
@@ -92,7 +92,7 @@ public final class ConfigurationDBUtils {
Logger.debug("Opening new hibernate session...");
try {
session = entitymanagerfactory.createEntityManager();
- THREAD_LOCAL.set(session);
+ THREAD_LOCAL_CONFIG.set(session);
} catch (HibernateException hex) {
Logger.error(hex.getMessage());
}
@@ -113,8 +113,8 @@ public final class ConfigurationDBUtils {
return;
}
Logger.debug("Closing current hibernate session...");
- Session session = (Session) THREAD_LOCAL.get();
- THREAD_LOCAL.set(null);
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
+ THREAD_LOCAL_CONFIG.set(null);
if (session != null) {
try {
session.close();