spring配置的一些问题
由于初学SPRING,对配置不太深入,所以想请教各位
(1):我用了<tx:annotation-driven transaction-manager="txManager"/>
(2)<!-- 那些类使用事务 -->
<aop:config>
<aop:pointcut id="point-cut" expression="execution(* com.wlh.spring.manager.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="point-cut"/>
</aop:config>
(1)和(2)有什么区别呢?
(1)我试过了好象也可以在任何地方用的,那么既然有了(1)了为什么还要有(2)呢,这两者到底有什么不同呢?哪个更强大呢,有了(2)还要不要(1)呢
<!-- 配置事务传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionMgr">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice> 这个又是指什么意思呢?难道前面的事务配置还不包括这些add,insert,del等语句吗?蒙!!蒙啊!谁来救我啊!!!