diff options
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java index 59398c922..1fa5a20fd 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/HibernateUtil.java @@ -128,9 +128,12 @@ public final class HibernateUtil { Transaction tx = null; try { Session session = HibernateUtil.getCurrentSession(); - tx = session.beginTransaction(); - session.saveOrUpdate(dbo); - tx.commit(); + + synchronized (session) { + tx = session.beginTransaction(); + session.saveOrUpdate(dbo); + tx.commit(); + } return true; } catch(HibernateException e) { @@ -144,9 +147,13 @@ public final class HibernateUtil { Transaction tx = null; try { Session session = HibernateUtil.getCurrentSession(); - tx = session.beginTransaction(); - session.delete(dbo); - tx.commit(); + + synchronized (session) { + tx = session.beginTransaction(); + session.delete(dbo); + tx.commit(); + } + return true; } catch(HibernateException e) { |