spring ibatis事务管理 为什么我在service层开启的事务,在dao层中仍能够操作数据? 10
<!--事务管理器--><beanid="transactionManager"class="org.springframework.jdbc.datasource.Da...
<!-- 事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 配置AOP -->
<aop:config proxy-target-class="true">
<aop:pointcut id="ssi" expression="execution(* com.ssi2.test.serviceimpl.*.*(..))"/>
<aop:advisor pointcut-ref="ssi" advice-ref="txAdvice" />
</aop:config>
<!-- 配置事务特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="query*" propagation="NESTED" />
</tx:attributes>
</tx:advice> 展开
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 配置AOP -->
<aop:config proxy-target-class="true">
<aop:pointcut id="ssi" expression="execution(* com.ssi2.test.serviceimpl.*.*(..))"/>
<aop:advisor pointcut-ref="ssi" advice-ref="txAdvice" />
</aop:config>
<!-- 配置事务特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="query*" propagation="NESTED" />
</tx:attributes>
</tx:advice> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询