Hi Community'guys:
I have the following case:
Code:class A implements IA { void saveTxC(C c) { B b = getTxCurrentB(); c.setB(b); dao.save(c); } B getTxCurrentB() { B b = dao.getCurremtB(); return b; } }I am not using cglib but I only use the jdk proxy.Code:<bean id="txService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true" lazy-init="true"> <property name="transactionManager"> <ref bean="txManager"/> </property> <property name="transactionAttributes"> <props> <prop key="getTx*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="saveTx*">PROPAGATION_REQUIRED</prop> </props> </property> <property name="preInterceptors"> <list> <ref bean="preFilterDomainsByClienteWeb" /> <ref bean="setterClienteWebAndUserInMethod"/> <ref bean="securityInterceptor"/> </list> </property> <property name="postInterceptors"> <list> <ref bean="postFilterDomainsByClienteWeb" /> </list> </property> </bean> <bean id="aTarget" class="A" parent="baseService"/> <bean id="a" parent="txService"> <property name="proxyTargetClass" value="false" /> <property name="optimize" value="false" /> <property name="target"> <ref bean="aTarget"/> </property> <property name="proxyInterfaces"> <list> <value type="java.lang.Class">IA</value> </list> </property> </bean>
The method a.getTxCurrentB() calls the preInterceptos and postInterceptor, it is correct.
The method a.savaTxC(c) calls the preInterceptos and postInterceptor, it is correct.
But if the method a.saveTxC(c) is called, the inner getTxCurrentB() is called too but its attached interceptors are not called.
The interceptors have different behaviours for each method.
I need to know if it's possible that inner getTxCurrentB() has the interceptor available when calling from a.savaTxC(c).
Thanks a lot.


Reply With Quote