hibernate 问题集

1、Could not obtain transaction-synchronized Session for current thread

解决方法:

在web.xml中加入如下配置:

 <filter>
        <filter-name>SpringOpenSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>SpringOpenSessionInViewFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 

posted @ 2015-01-22 15:14  tyb1222  阅读(365)  评论(0编辑  收藏  举报