话说我没遇到过。这个问题是否可以debug下,能确认问题是出在spring还是hibernate。可以给他们发邮件反馈

解决方案 »

  1.   

    hibernate是没有问题的,项目目前改成直接使用Hibernate的形式了,spring不再管理事务,这样就没有问题。就是spring的一个bug。
      

  2.   

    能否把spring事务的相关代码贴一下,平时没遇到这个问题
      

  3.   

    也没什么代码了,就是标准的声明式事务管理。问题时一定有的,并不是我这个是什么特例。如果有解决过的能赐教一下,或者用过高版本的看看这个问题是否依然存在,我正在配置spring4的环境,希望没有这个问题了
    <bean id="txManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
    <ref local="sessionFactory" />
    </property>
    </bean>
    <aop:config>
    <aop:pointcut id="serviceOperation"
    expression="execution(* com.xxx.service.*.*(..))" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
    </aop:config> <tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <tx:method name="*" read-only="true" />
    <tx:method name="save*"  read-only="false" propagation="REQUIRED"/>
    <tx:method name="update*" read-only="false"  propagation="REQUIRED"/>
    <tx:method name="remove*"  read-only="false" propagation="REQUIRED"/>
    </tx:attributes>
    </tx:advice>
      

  4.   

    难道真的没人注意到这个bug吗?
      

  5.   

    肯定不是这个问题,spring的一个bug,网上我看了一些博客,并自己做了实验,可以确定是spring的一个问题。
      

  6.   

    哎,结贴把,用spring4和hibernate4又实验了一番,还是不行啊。在现有模式下估计spring是搞不定这个问题了。