Results 1 to 2 of 2

Thread: no-rollback-for not working

  1. #1
    Join Date
    Nov 2008
    Posts
    17

    Exclamation no-rollback-for not working

    I have been struggling for a while with the following issue. When I configure the following transactions are still being rolled back:
    Code:
    	<tx:advice id="txPrvAdviceManager" transaction-manager="transactionManager">
    		<tx:attributes>
    			<tx:method name="process*" propagation="REQUIRED" no-rollback-for="nl.test.provisioning.core.business.manager.exception.ProvisioningException" />
    			<tx:method name="get*" propagation="NEVER" />
    			<tx:method name="set*" propagation="NEVER" />
    		</tx:attributes>
    	</tx:advice>
    
    	<aop:config>
    		<aop:pointcut id="prvManagerOperation"
    			expression="execution(* nl.test.provisioning.core.business.manager.impl.*ManagerImpl.*(..))" />
    		<aop:advisor advice-ref="txPrvAdviceManager" pointcut-ref="prvManagerOperation" />
    	</aop:config>
    Spring IDE confirms that the pointcut is valid and I also see it working runtime. The only weird thing is that if the ProvisioningException is thrown in a manager a rollback is still initiated since I see the following exception being thrown from the manager:
    Code:
    org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
    I expect the ProvisioningException to be thrown but that doesn't happen since it for some reason ignores my AOP configuration.

    Does anybody know what I am doing wrong?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Make sure that everything is within the same transaction and when you use MySQL make sure you use InnodB tables (MyISAM tables don't support transactions).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

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