From b4e8ddb0d86aa9c85fbb739ef87775faea54d2f4 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 3 Jun 2023 21:34:05 +0200 Subject: [PATCH] LDEV-4017 remove try and close --- .../hibernate/HibernateORMTransaction.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) 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 06f0fe3e..11316b58 100755 --- a/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java +++ b/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMTransaction.java @@ -88,23 +88,20 @@ public void rollback() { @Override public void end() { // try was removed in ortus branch - 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(); } + } /**