也没什么代码了,就是标准的声明式事务管理。问题时一定有的,并不是我这个是什么特例。如果有解决过的能赐教一下,或者用过高版本的看看这个问题是否依然存在,我正在配置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>