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,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);
|
||||
|
|
Loading…
Reference in New Issue