mirror of
https://github.com/google/nomulus.git
synced 2025-07-03 01:33:29 +02:00
Make sure uncommitted txn is rolled back (#665)
* Make sure uncommit txn is rolled back The try block around commit that catches RuntimeException should also catch Error, which is also unchecked.
This commit is contained in:
parent
43230eee09
commit
a871564ea2
1 changed files with 2 additions and 1 deletions
|
@ -101,7 +101,8 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
|||
T result = work.get();
|
||||
txn.commit();
|
||||
return result;
|
||||
} catch (RuntimeException e) {
|
||||
} catch (RuntimeException | Error e) {
|
||||
// Error is unchecked!
|
||||
try {
|
||||
txn.rollback();
|
||||
logger.atWarning().log("Error during transaction; transaction rolled back");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue