HHH-18491 Do no try to resume non-existant transaction in doInSuspendedTransaction.
This commit is contained in:
parent
7b176df6b7
commit
4a65c51326
|
@ -114,7 +114,9 @@ public class JtaIsolationDelegate implements IsolationDelegate {
|
||||||
try {
|
try {
|
||||||
// First we suspend any current JTA transaction
|
// First we suspend any current JTA transaction
|
||||||
final Transaction surroundingTransaction = transactionManager.suspend();
|
final Transaction surroundingTransaction = transactionManager.suspend();
|
||||||
|
if ( surroundingTransaction != null ) {
|
||||||
LOG.debugf( "Surrounding JTA transaction suspended [%s]", surroundingTransaction );
|
LOG.debugf( "Surrounding JTA transaction suspended [%s]", surroundingTransaction );
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return callable.call();
|
return callable.call();
|
||||||
|
@ -124,9 +126,11 @@ public class JtaIsolationDelegate implements IsolationDelegate {
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
try {
|
try {
|
||||||
|
if ( surroundingTransaction != null ) {
|
||||||
transactionManager.resume( surroundingTransaction );
|
transactionManager.resume( surroundingTransaction );
|
||||||
LOG.debugf( "Surrounding JTA transaction resumed [%s]", surroundingTransaction );
|
LOG.debugf( "Surrounding JTA transaction resumed [%s]", surroundingTransaction );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch ( Throwable t2 ) {
|
catch ( Throwable t2 ) {
|
||||||
// if the actually work had an error use that, otherwise error based on t
|
// if the actually work had an error use that, otherwise error based on t
|
||||||
if ( originalException == null ) {
|
if ( originalException == null ) {
|
||||||
|
|
Loading…
Reference in New Issue