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:
Adam Warski 2009-11-24 09:19:47 +00:00
parent 5b6a8eee07
commit 9d5f0d084a
1 changed files with 9 additions and 2 deletions

View File

@ -168,10 +168,17 @@ public class AuditSync implements Synchronization {
}
} catch (RuntimeException e) {
// Rolling back the transaction in case of any exceptions
//noinspection finally
try {
if (session.getTransaction().isActive()) {
session.getTransaction().rollback();
}
} finally {
//noinspection ThrowFromFinallyBlock
throw e;
}
}
}
public void afterCompletion(int i) {
manager.remove(transaction);