Announcement Announcement Module
No announcement yet.
Having issues with Transaction Annotations Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Having issues with Transaction Annotations


    I'm struggling with trx annotations using Spring 1.2.2. It seems to work with some interfaces but not others and I have no idea why. I put a debug in the TransactionInterceptor class and it is clear that my interfaces which definitely have annotations never reach the breakpoint while the one interface that works definitely does hit the breakpoint. I even changed the transactional annotation to readonly for the entire interface to try to break a write to the db and the write succeeded. It's obvious that the class is never being considered as having trx annotations. I also tried moving the annotation to the implementation class and still it didn't work.

    There is nothing special about the interface:

    public interface ItemService {

    related beans in app context:

    		class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
    		<property name="transactionInterceptor">
    			<ref bean="transactionInterceptor" />
    	<bean id="transactionInterceptor"
    		<property name="transactionManager">
    			<ref bean="hibernateTransactionManager" />
    		<property name="transactionAttributeSource">
    				class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource" />
    <bean id="itemService"
    		... &#40;just a bunch of properties&#41;
    Thanks for any help you can provide,


  • #2
    Ok, I've narrowed down which interfaces work and which ones don't. It appears as though that an interface with one method works fine but one with more than one method does not work. My ItemService has about 15 methods defined in the interface and none of them go through the TransactionInterceptor.


    • #3
      Ok, reverted back to Spring 1.2.1 and it works, so it must be a bug in Spring 1.2.2. I'll add it to Jira.