반응형
build.gradle
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.7'
servlet.context.xml
<tx:annotation-driven proxy-target-class="true"/>
얘는 <beans:beans> 영역에 추가
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
mybatis.context.xml
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" rollback-for="Exception"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="requiredTx" expression="execution(* com.pangpany.dcaf..*Impl.*(..)) "/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="requiredTx" />
</aop:config>
얘는 <beans:beans> 영역에 추가
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="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"
반응형
'나의 개발 기록 > Java /Spring' 카테고리의 다른 글
[JAVA] startWith, endsWith / 특정 문자로 시작하거나 끝나는지 체크하는 함수 (0) | 2023.04.20 |
---|---|
[JSTL] 날짜를 숫자로, 날짜를 포맷하기 (0) | 2022.11.18 |
[Java] 현재날짜, 현재날짜/시간 구하기 (0) | 2022.11.18 |
[JAVA] jwt 생성,발급,유효성검사 (0) | 2022.10.13 |
[JAVA] 전자정부프레임워크 util:properties로 프로퍼티 사용하기 (feat. @value로 값출력) (0) | 2022.09.14 |
댓글