Created
December 25, 2011 22:03
-
-
Save eugenp/1519810 to your computer and use it in GitHub Desktop.
Transaction configuration with Spring 3.1 - the AOP config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:aop="http://www.springframework.org/schema/aop" | |
| xmlns:tx="http://www.springframework.org/schema/tx" | |
| xsi:schemaLocation=" | |
| http://www.springframework.org/schema/beans | |
| http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | |
| http://www.springframework.org/schema/tx | |
| http://www.springframework.org/schema/tx/spring-tx-3.1.xsd | |
| http://www.springframework.org/schema/aop | |
| http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"> | |
| <tx:advice id="txAdvice" transaction-manager="txManager"> | |
| <tx:attributes> | |
| <tx:method name="get*" read-only="true" /> | |
| <tx:method name="*" /> | |
| </tx:attributes> | |
| </tx:advice> | |
| <aop:config> | |
| <aop:pointcut id="serviceOperation" expression="execution(* org.rest.service.*.*(..))" /> | |
| <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" /> | |
| </aop:config> | |
| </beans> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is used in:
http://www.baeldung.com/2011/12/26/transaction-configuration-with-jpa-and-spring-3-1/