org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate

来源:互联网 发布:protobuf数据解析 编辑:程序博客网 时间:2024/04/27 05:56

spring3+hibernate4+springmvc


异常:

org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate3.SessionHolder


由于hibernate4已经完全可以实现事务了 与spring3.1中的hibernatedao,hibernateTemplete等有冲突,所以spring3.1里已经不提供hibernatedaosupport,hibernateTemplete了,只能用hibernate原始的方式用session。
获得session:getSessionFactory().getCurrentSession()。

0 0
原创粉丝点击