views:

37

answers:

0

My spring definition regarding trasnsaction are defined as following:

<bean id="txInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <property name="transactionManager" ref="transactionManager"/>
</bean>

<aop:config>

        <aop:pointcut id="defaultServiceOperation"
                    expression="execution(* x.y.service.*Service.*(..))"/>


        <aop:advisor pointcut-ref="defaultServiceOperation" advice-ref="defaultTxAdvice"/>

</aop:config>


<tx:advice id="defaultTxAdvice">
        <tx:attributes>                        
          <tx:method name="*"/>
        </tx:attributes>
</tx:advice>

Now, I'd like to add some additional interceptors that my App contains, that will run before every time that transaction interceptor is invoked. i.e. I'd like to add to the pointcut 'defaultServiceOperation' other advise, or add to the 'defaultTxAdvice' pre interceptors. Something like:

<property name="preInterceptors">
           <list>
               <ref bean="optimisticLockingInterceptor"/>
               <ref bean="deadLockingInterceptor"/>            
           </list>
</property>

Is it possible and how can I do it?