에러노트 Version 1.0.0
Transaction error - 설정했는데도 Roll back이 안되고 Commit이 될 때 확인해볼것.
관리자
2016-09-08 22:27
JPCMS는 폴더구조가 Sprign 폴더 하위에 root-context.xml 과 servlet-context.xml이 있습니다.
Transaction 설정을 했는데도 그냥 계속 중간중간 Service가 커밋이 되서 애먹은 적이 있었는데요.
context.xml파일안에 context:component-scan 으로 해결했습니다.
context:include-filter와
context:exclude-filter로 나눠서 작성하면 되는데요.
root-context.xml 에는 기능적인 Service와 Repository를
<context:component-scan base-package="com.jpr">
<context:include-filter expression="org.springframework.stereotype.Service" type="annotation"/>
<context:include-filter expression="org.springframework.stereotype.Repository" type="annotation"/>
<context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
</context:component-scan>
servlet-context.xml 에는 화면컨트롤을 하는 Controller를
<context:component-scan base-package="com.jpr">
<context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
<context:exclude-filter expression="org.springframework.stereotype.Service" type="annotation"/>
<context:exclude-filter expression="org.springframework.stereotype.Repository" type="annotation"/>
</context:component-scan>
include해 Transaction error문제를 해결했습니다.
- 댓글 목록 [ 0 ]