Class CouchbaseTransactionInterceptor
java.lang.Object
org.springframework.transaction.interceptor.TransactionAspectSupport
org.springframework.transaction.interceptor.TransactionInterceptor
org.springframework.data.couchbase.transaction.CouchbaseTransactionInterceptor
- All Implemented Interfaces:
Serializable
,Advice
,Interceptor
,MethodInterceptor
,Aware
,BeanFactoryAware
,InitializingBean
@Internal
public class CouchbaseTransactionInterceptor
extends TransactionInterceptor
implements MethodInterceptor, Serializable
This allows reactive @Transactional support with Couchbase transactions.
The ReactiveTransactionManager does not support the lambda-based nature of Couchbase transactions, and there is no reactive equivalent of CallbackPreferringTransactionManager (which does).
The solution: override the standard TransactionInterceptor and, if the CouchbaseCallbackTransactionManager is the provided TransactionManager, defer to that.
- Author:
- Graham Pople, Michael Reiche
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
TransactionAspectSupport.CoroutinesInvocationCallback, TransactionAspectSupport.InvocationCallback, TransactionAspectSupport.TransactionInfo
-
Field Summary
Fields inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
logger
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
invokeWithinTransaction
(Method method, Class<?> targetClass, TransactionAspectSupport.InvocationCallback invocation) Methods inherited from class org.springframework.transaction.interceptor.TransactionInterceptor
invoke
Methods inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
afterPropertiesSet, cleanupTransactionInfo, clearTransactionManagerCache, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, methodIdentification, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.aopalliance.intercept.MethodInterceptor
invoke
-
Constructor Details
-
CouchbaseTransactionInterceptor
-
-
Method Details
-
invokeWithinTransaction
@Nullable protected Object invokeWithinTransaction(Method method, @Nullable Class<?> targetClass, TransactionAspectSupport.InvocationCallback invocation) throws Throwable - Overrides:
invokeWithinTransaction
in classTransactionAspectSupport
- Throws:
Throwable
-