|
|
|
@ -5,6 +5,11 @@
|
|
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans |
|
|
|
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"> |
|
|
|
|
|
|
|
|
|
<!-- |
|
|
|
|
通过AOP来配置声明式 DB事务(transaction). |
|
|
|
|
service包中的 以 load, is 开头的方法是只读事务(read-only) |
|
|
|
|
其他则全写事务(write) |
|
|
|
|
--> |
|
|
|
|
<!--aop--> |
|
|
|
|
<aop:config> |
|
|
|
|
<aop:advisor advice-ref="applicationAdvisor" pointcut="execution(* com.monkeyk.sos.service.*.*(..))"/> |
|
|
|
@ -15,6 +20,7 @@
|
|
|
|
|
<tx:attributes> |
|
|
|
|
<tx:method name="*" propagation="REQUIRED"/> |
|
|
|
|
<tx:method name="load*" propagation="SUPPORTS" read-only="true"/> |
|
|
|
|
<tx:method name="is*" propagation="SUPPORTS" read-only="true"/> |
|
|
|
|
</tx:attributes> |
|
|
|
|
</tx:advice> |
|
|
|
|
|
|
|
|
|