Not swallowing exceptions in some cases when a tx is rolled back by Envers
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18028 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
5b6a8eee07
commit
9d5f0d084a
|
@ -168,8 +168,15 @@ public class AuditSync implements Synchronization {
|
|||
}
|
||||
} catch (RuntimeException e) {
|
||||
// Rolling back the transaction in case of any exceptions
|
||||
session.getTransaction().rollback();
|
||||
throw e;
|
||||
//noinspection finally
|
||||
try {
|
||||
if (session.getTransaction().isActive()) {
|
||||
session.getTransaction().rollback();
|
||||
}
|
||||
} finally {
|
||||
//noinspection ThrowFromFinallyBlock
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue