在SSH框架中方法,我们一般都会把方法配置成支持事物。
但有时,由于业务需要,有些方法要配置成不支持事物。
<bean id="datasource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/xxxxxxDS</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="datasource" />
</property>
</bean>
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveGoodsImage">PROPAGATION_NOT_SUPPORTED</prop>
<prop key="createTblInterfaceHis">PROPAGATION_REQUIRES_NEW</prop>
</props>
</property>
</bean>
SSH框架事务管理
本文介绍在SSH框架中如何通过配置实现方法级别的事务管理。重点介绍了如何配置某些方法为不支持事务,以满足特定业务需求。
3万+

被折叠的 条评论
为什么被折叠?



