일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 줄바꿈 문자
- ssh
- context
- 네트워크
- Source
- JavaScript
- resource
- plugin
- maVen
- tomcat
- find
- bash
- grep
- Mac
- profile
- Windows
- VirtualBox
- import
- port
- 단축키
- web.xml
- Quartz
- lsof
- Eclipse
- xargs
- IntelliJ
- netsh
- Windows 10
- GIT
- vscode
- Today
- Total
develog
[Java] @Transactional, tx:advice MIX 본문
Mixing Spring AOP Declarative Transaction with @Transactional
https://gist.github.com/rponte/3181934
<?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:context="http://www.springframework.org/schema/context" 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.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<context:annotation-config /> <context:component-scan base-package="br.com.triadworks" /> <tx:annotation-driven order="1" />
<tx:advice id="txAdvice"> <tx:attributes> <!-- all methods starting with 'get' are read-only --> <tx:method name="find*" read-only="true" /> <tx:method name="count*" read-only="true" /> <tx:method name="get*" read-only="true" /> <tx:method name="busca*" read-only="true" /> <tx:method name="lista*" read-only="true" /> <!-- other methods use the default transaction settings (see below) --> <tx:method name="*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>
<aop:config> <aop:pointcut id="serviceMethods" expression="execution(* br.com.syspdv.triadworks..*.*(..)) and not @annotation(org.springframework.transaction.annotation.Transactional)" /> <aop:advisor order="2" advice-ref="txAdvice" pointcut-ref="serviceMethods" /> </aop:config>
</beans> |
'Dev > Java' 카테고리의 다른 글
[Java] Map inline put (0) | 2014.11.19 |
---|---|
[Java] Spring @Transactional explained (0) | 2014.10.07 |
[Java] Generics (0) | 2014.10.06 |
[Java] template callback return value (0) | 2014.10.01 |
[Java] 톰캣 설치 폴더 찾기 (0) | 2014.09.24 |