Hi, I've got an object A which implements an interface (RohanSequencer).
This interface has 2 public methods : execute and doInTransaction.
I want to put an aspect for transaction management around "doInTransaction".
"doInTransaction" is called by "execute" method and it seems not to work. if I call "doInTransaction" outside the "execute" Method (i.e, immediately after called applicationContext.getBeans on object A ), it works.
Here's a fragment of my Spring configuration :
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<aop:config>
<aopointcut id="sequencerIntercept"
expression="execution(* com.rohan.sequencer.api.RohanSequencer.doInTransac tion (..))" />
<aop:advisor advice-ref="transactionSequencerAdvice" pointcut-ref="sequencerIntercept" />
</aop:config>
<tx:advice id="transactionSequencerAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="doInTransaction" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
Is there a way to solve the problem ? Without split my 2 methods in two differents object ?
Regards,
E. Lewandowski


ointcut id="sequencerIntercept"
Reply With Quote
