(158) - 对配置,代码必要的地方添加注释,方便理解
parent
b884588d1a
commit
15094acaf4
|
@ -7,6 +7,11 @@
|
|||
http://www.springframework.org/schema/cache
|
||||
http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<!--
|
||||
缓存的配置, 使用Spring cache + EhCache.
|
||||
在使用时使用Spring cache 注解,如 @Cacheable
|
||||
ehcache.xml 配置主要的缓存设置
|
||||
-->
|
||||
<cache:annotation-driven/>
|
||||
|
||||
<!-- cache manager -->
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue