Results 1 to 3 of 3

Thread: Spring transaction rollback aop config

  1. #1
    Join Date
    Oct 2008
    Location
    Minneapolis, MN
    Posts
    39

    Default Spring transaction rollback aop config

    Hi, I have a question regarding rolling back Spring transactions using aop definitions.

    Code:
    <tx:advice id="txAdvice" transaction-manager="transactionManager">  
        <tx:attributes>  
            <tx:method name="save*" />  
        </tx:attributes>  
    </tx:advice>
    If I call service.save(), and save() throws a RuntimeException then everything works fine - the transaction is successfully rolled back.

    However if I call service.test(), and all test() does is call save(), then the transaction never gets rolled back.

    It's almost like Spring's TransactionInterceptor doesn't fire unless you call service.save() directly.

    Thoughts?

  2. #2
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

  3. #3
    Join Date
    Oct 2008
    Location
    Minneapolis, MN
    Posts
    39

    Default

    Thanks....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •