hibernate+spring报错

    xiaoxiao2025-10-21  8

    Spring4+Hibernate4运行报错Could not obtain transaction-synchronized Session for current thread

    原因:在service层上加了 @Transactional注解,但是在spring的配置文件中没有开启事务注解 解决办法:在applicationContext.xml中加入 如下配置 <tx:annotation-driven transaction-manager="transactionManager" />
    转载请注明原文地址: https://ju.6miu.com/read-1303383.html
    最新回复(0)