Hello,
I would like to use my own Aspect (derived from AbstractTransactionAspect) with <tx:annotation-driven mode="aspectj" .../>. For this, I tried having the following Class as spring bean (yes, I'm using <context:component-scan ../> as well):
However, this does not work. Spring still uses its own AnnotationTransactionAspect.Code:package org.nuclos.server.spring.tx; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Role; import org.springframework.transaction.annotation.AbstractTransactionManagementConfiguration; import org.springframework.transaction.config.TransactionManagementConfigUtils; @Configuration public class NuclosAspectJTransactionManagementConfiguration extends AbstractTransactionManagementConfiguration { NuclosAspectJTransactionManagementConfiguration() { } @Bean(name=TransactionManagementConfigUtils.TRANSACTION_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public NuclosAnnotationTransactionAspect transactionAspect() { NuclosAnnotationTransactionAspect txAspect = NuclosAnnotationTransactionAspect.aspectOf(); if (this.txManager != null) { txAspect.setTransactionManager(this.txManager); } return txAspect; } }
Any suggestions, anyone?
Cheers,
aanno


Reply With Quote
