mirror of
https://github.com/google/nomulus
synced 2026-01-11 08:20:27 +00: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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user