当前位置: 代码迷 >> 综合 >> Spring对Hibernate事务的管理
  详细解决方案

Spring对Hibernate事务的管理

热度:87   发布时间:2024-01-17 21:24:28.0

在Spring中增加对Hibernate事务的管理配置时需要注意下面两点:


1. 注意在配置文件中要增加对Aspectj的支持

    <!-- 启动Aspectj支持 --><aop:aspectj-autoproxy />  


2.  想增加事务的类 (切面类) 要写@Aspect注解



否则会出现下面的错误信息:

Exception in thread "main" org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'personDaoImpl' must be of type [com.syyyy.spring.PersonDaoImpl], but was actually of type [$Proxy8]