Merge branch '5.2.x'

# Conflicts:
#	build.gradle
This commit is contained in:
Juergen Hoeller 2020-06-17 15:42:18 +02:00
commit 7f79a373c3
2 changed files with 10 additions and 9 deletions

View File

@ -27,7 +27,7 @@ configure(allprojects) { project ->
mavenBom "io.netty:netty-bom:4.1.50.Final" mavenBom "io.netty:netty-bom:4.1.50.Final"
mavenBom "io.projectreactor:reactor-bom:2020.0.0-SNAPSHOT" mavenBom "io.projectreactor:reactor-bom:2020.0.0-SNAPSHOT"
mavenBom "io.rsocket:rsocket-bom:1.0.1" mavenBom "io.rsocket:rsocket-bom:1.0.1"
mavenBom "org.eclipse.jetty:jetty-bom:9.4.29.v20200521" mavenBom "org.eclipse.jetty:jetty-bom:9.4.30.v20200611"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.4-M2" mavenBom "org.jetbrains.kotlin:kotlin-bom:1.4-M2"
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7-1.4-M2" mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7-1.4-M2"
mavenBom "org.junit:junit-bom:5.6.2" mavenBom "org.junit:junit-bom:5.6.2"

View File

@ -388,11 +388,12 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
} }
else { else {
Object result;
final ThrowableHolder throwableHolder = new ThrowableHolder(); final ThrowableHolder throwableHolder = new ThrowableHolder();
// It's a CallbackPreferringPlatformTransactionManager: pass a TransactionCallback in. // It's a CallbackPreferringPlatformTransactionManager: pass a TransactionCallback in.
try { try {
Object result = ((CallbackPreferringPlatformTransactionManager) ptm).execute(txAttr, status -> { result = ((CallbackPreferringPlatformTransactionManager) ptm).execute(txAttr, status -> {
TransactionInfo txInfo = prepareTransactionInfo(ptm, txAttr, joinpointIdentification, status); TransactionInfo txInfo = prepareTransactionInfo(ptm, txAttr, joinpointIdentification, status);
try { try {
Object retVal = invocation.proceedWithInvocation(); Object retVal = invocation.proceedWithInvocation();
@ -422,12 +423,6 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
cleanupTransactionInfo(txInfo); cleanupTransactionInfo(txInfo);
} }
}); });
// Check result state: It might indicate a Throwable to rethrow.
if (throwableHolder.throwable != null) {
throw throwableHolder.throwable;
}
return result;
} }
catch (ThrowableHolderException ex) { catch (ThrowableHolderException ex) {
throw ex.getCause(); throw ex.getCause();
@ -445,11 +440,17 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
} }
throw ex2; throw ex2;
} }
// Check result state: It might indicate a Throwable to rethrow.
if (throwableHolder.throwable != null) {
throw throwableHolder.throwable;
}
return result;
} }
} }
/** /**
* Clear the cache. * Clear the transaction manager cache.
*/ */
protected void clearTransactionManagerCache() { protected void clearTransactionManagerCache() {
this.transactionManagerCache.clear(); this.transactionManagerCache.clear();