application.xml 配置-------------------------------
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="txManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="merge*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
service 配置------------------
<bean id="loginService" parent="txProxyTemplate">
<property name="target">
<bean
class="com.play.login.service.impl.LoginServiceImpl">
<property name="loginDao" ref="loginDao" />
</bean>
</property>
</bean>
达令说