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 TransactionAspectSupport
TransactionAspectSupport.InvocationCallback, TransactionAspectSupport.TransactionInfo -
Field Summary
Fields inherited from class TransactionAspectSupport
logger -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ObjectinvokeWithinTransaction(Method method, @Nullable Class<?> targetClass, TransactionAspectSupport.InvocationCallback invocation) Methods inherited from class TransactionInterceptor
invokeMethods inherited from class TransactionAspectSupport
afterPropertiesSet, cleanupTransactionInfo, clearTransactionManagerCache, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, methodIdentification, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MethodInterceptor
invoke
-
Constructor Details
-
CouchbaseTransactionInterceptor
-
-
Method Details
-
invokeWithinTransaction
protected @Nullable Object invokeWithinTransaction(Method method, @Nullable Class<?> targetClass, TransactionAspectSupport.InvocationCallback invocation) throws Throwable - Overrides:
invokeWithinTransactionin classTransactionAspectSupport- Throws:
Throwable
-