我如下配置TransactionInterceptor时不能进行回滚<bean id="tranInterceptor" 
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="tranManage"/>
</property>
<property name="transactionAttributeSource">
<value>com.regest.biz.businessImp.RegestBizImp.setStudent=PROPAGATION_REQUIRED</value>
</property>
</bean>但是我做如下修改后,却能进行了回滚<bean id="tranInterceptor" 
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="tranManage"/>
</property>
<property name="transactionAttributes">
<props> 
<prop key="setStudent">PROPAGATION_REQUIRED</prop>  
</props> 
</property>
</bean>
这是什么原因啊
我用的spring jar包是myeclipse5.1自带的,spring的版本应该是1.2.6
数据库采用的mysql 但是表的类型已经声明为 InnoDB
非常感谢您能回答我的问题 谢谢!

解决方案 »

  1.   

    但是第二种格式不能具体到包名和类名啊
    如果采用第二种格式,所有容器中的setStudent方法都会被事务包括啊
      

  2.   


    <bean id="tranInterceptor" 
    class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
    <property name="transactionManager"> 
    <ref bean="tranManage"/> 
    </property> 
    <property name="target" ref="BeanId">
    <property name="transactionAttributes"> 
    <props> 
    <prop key="setStudent">PROPAGATION_REQUIRED </prop>  
    </props> 
    </property> 
    </bean>指定某个类
    声明这个Bean就可以了