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