0
나는 프로젝트를 업그레이드하려고하고있어 거래를하기 위해왔다. 이것이 내가 지금까지 한 일이다. 서비스를 봄에서 특정 txAdvice를 사용하는 방법?
<bean id="userServiceTarget" class="com.forgin.service.UserServiceImpl">
<property name="userDAO" ref="userDAO" />
</bean>
<bean id="userService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="target" ref="userServiceTarget" />
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_SUPPORTS</prop>
<prop key="is*">PROPAGATION_SUPPORTS</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
나는 트랜잭션이 울부 짖는 소리와 같은 속성을 변경,하지만 난 정확히
txAdvice
와 서비스를 연결할 수있는 방법을 아주 확실하지 않다. 왜냐하면 나는 일반적으로 다른 서비스에 대해 서로 다른 트랜잭션 속성을 가지고 있기 때문에 하나 이상의
txAdvice
이되어야한다. 이 특정 txAdvice를 사용하여
@Transactional
을 말하는 방법이 있습니까?
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="get*" read-only="true" />
<tx:method name="is*" read-only="true" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>