메뉴 건너띄기
상단메뉴 바로가기
본문 바로가기

이 누리집은 대한민국 공식 전자정부 누리집입니다.

본문 영역

적용 지원, FAQ, Q&A 게시판을 통해 기술 문제 해결을 지원합니다.

묻고 답하기

transaction 관련 추가 문의드려요
  • 작성자

    전*아

  • 작성일

    2011-06-09 18:26:59

  • 조회수

    2,994

  • 구분

    실행환경

  • 진행상태

    완료

질문

안녕하세요
트랜잭션 관련문의 드리고 답변글 받았는데요.

===답변=========
다만, <tx:method/>의 propagation 부분에는 "PROPAGATION_REQUIRED"와 같이 앞에 "PROPAGATION_" prefix를 주시면 되실 것 같습니다.

그래서 아래와 같이 수정을 하였는데
------------ context-transaction.xml-------------
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>

<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="*" propagation="PROPAGATION_REQUIRED" rollback-for="Exception"/>
</tx:attributes>
</tx:advice>

<aop:config>
<aop:pointcut id="requiredTx"
expression="execution(* egovframework.com..*Impl.*(..)) or
execution(* egovframework.rte.fdl.excel.impl.*Impl.*(..)) or
execution(* sr..*Impl.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="requiredTx" />
</aop:config>

== 에러메세지 ==
Multiple annotations found at this line:
- cvc-enumeration-valid: Value 'PROPAGATION_REQUIRED' is not facet-valid with respect to enumeration '[REQUIRED, SUPPORTS,
MANDATORY, REQUIRES_NEW, NOT_SUPPORTED, NEVER, NESTED]'. It must be a value from the enumeration.
- cvc-attribute.3: The value 'PROPAGATION_REQUIRED' of attribute 'propagation' on element 'tx:method' is not valid with respect to its type,
'null'.

위와 같은 메세지가 납니다~
답변 꼭~ 부탁드립니다~

답변

안녕하세요.. 전영아님..

우선 혼선을 드려 죄송합니다. (기존 REQUIRED로 지정하는 것이 맞습니다.)

이 경우 발생된 Exception trace 상에 "org.springframework.transaction" 패키지로 되어 있는 부분이 호출되었는지 확인하여..
실제 transactionManager가 호출 여부를 확인해야 할 것 같습니다.
(Exception trace를 올려 주셔도 됨)

다른 가능성은....
txManager에 지정된 dataSource가 해당 DAO에 지정된 dataSource가 맞는지 확인 부탁드립니다. (당연히 맞겠지만.. 혹시 몰라서...)

그럼.. 즐거운 하루되십시오.
감사합니다.

이 페이지의 구성

묻고 답하기