From b70223d090240d60b57c927ce4e8cfc70ef6577a Mon Sep 17 00:00:00 2001 From: Michael Born Date: Wed, 27 Jul 2022 10:01:17 -0400 Subject: [PATCH 1/2] Don't close ORM session on transaction end Resolves LDEV-4017. --- build.number | 4 ++-- .../hibernate/HibernateORMTransaction.java | 24 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/build.number b/build.number index 0be31367..1020c0b1 100644 --- a/build.number +++ b/build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Fri May 13 20:35:55 CEST 2022 -build.number=16 +#Wed Jul 27 09:59:14 EDT 2022 +build.number=17 diff --git a/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java b/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java index 09b2d2c5..b9a546d2 100755 --- a/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java +++ b/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java @@ -43,23 +43,17 @@ public void rollback() { @Override public void end() { - try { - if (doRollback) { - trans.rollback(); - if (autoManage) { - session.clear(); - } - } - else { - if (trans.getStatus() == TransactionStatus.COMMITTED) { - trans.commit(); - } - session.flush(); + if (doRollback) { + trans.rollback(); + if (autoManage) { + session.clear(); } } - finally { - session.close(); + else { + if (trans.getStatus() == TransactionStatus.COMMITTED) { + trans.commit(); + } + session.flush(); } - } } From 13f2dc1fb72d34c2cc1cd41a1a3695a398372309 Mon Sep 17 00:00:00 2001 From: Michael Born Date: Wed, 27 Jul 2022 10:24:40 -0400 Subject: [PATCH 2/2] Tweak build file to trigger a test run --- build.number | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.number b/build.number index 1020c0b1..b284fc3a 100644 --- a/build.number +++ b/build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Wed Jul 27 09:59:14 EDT 2022 -build.number=17 +#Wed Jul 27 10:22:33 EDT 2022 +build.number=17 \ No newline at end of file