Hibernate: getCurrentSession报错

阅读 55

2022-07-27


需要在Spring的配置文件配置事务

<tx:advice id="txAdvice" transaction-manager="transactionManager">  
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>

<aop:config>
<aop:pointcut id="interceptorPointCuts" expression="execution(* service.*.*(..))"

/>
<aop:advisor advice-ref=“txAdvice” pointcut-ref=“interceptorPointCuts” />
</aop:config>


精彩评论(0)

0 0 举报