Rollback Transaction when an AssertionError occurrs
This commit is contained in:
parent
6bd7a4d972
commit
c1fcb6cb92
|
@ -446,6 +446,18 @@ public class EntityManagerFactoryExtension
|
|||
|
||||
throw e;
|
||||
}
|
||||
catch (AssertionError t) {
|
||||
try {
|
||||
txn.rollback();
|
||||
}
|
||||
catch (Exception ignore) {
|
||||
log.trace( "Was unable to roll back transaction" );
|
||||
// really nothing else we can do here - the attempt to
|
||||
// rollback already failed and there is nothing else
|
||||
// to clean up.
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -485,6 +497,18 @@ public class EntityManagerFactoryExtension
|
|||
|
||||
throw e;
|
||||
}
|
||||
catch (AssertionError t) {
|
||||
try {
|
||||
txn.rollback();
|
||||
}
|
||||
catch (Exception ignore) {
|
||||
log.trace( "Was unable to roll back transaction" );
|
||||
// really nothing else we can do here - the attempt to
|
||||
// rollback already failed and there is nothing else
|
||||
// to clean up.
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -391,6 +391,18 @@ public class SessionFactoryExtension
|
|||
|
||||
throw e;
|
||||
}
|
||||
catch (AssertionError t) {
|
||||
try {
|
||||
txn.rollback();
|
||||
}
|
||||
catch (Exception ignore) {
|
||||
log.trace( "Was unable to roll back transaction" );
|
||||
// really nothing else we can do here - the attempt to
|
||||
// rollback already failed and there is nothing else
|
||||
// to clean up.
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -429,6 +441,18 @@ public class SessionFactoryExtension
|
|||
|
||||
throw e;
|
||||
}
|
||||
catch (AssertionError t) {
|
||||
try {
|
||||
txn.rollback();
|
||||
}
|
||||
catch (Exception ignore) {
|
||||
log.trace( "Was unable to roll back transaction" );
|
||||
// really nothing else we can do here - the attempt to
|
||||
// rollback already failed and there is nothing else
|
||||
// to clean up.
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue