org.hibernate.LazyInitalizationException

Error message: org.hibernate.LazyInitalizationException ..., no session or session was closed

Analysis:

When the statistics when the number of sub-classification, entity objects are already in session beyond the free state, Hibernate's transaction default lazy = "true", therefore, the program data in their admission of error

Solution:

In the web.xml file to set up Filter

<!-- To Solve an org.hibernate.LazyInitalizationException -->
	<filter>
		<filter-name>Spring penEntityManagerInViewFilter</filter-name>
		<!-- Include this if you are using Hibernate -->
		<!-- org.springframework.orm.hibernate3.support.OpenSessionInViewFilter For hibernate +spring -->
	<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>SpringOpenEntityManagerInViewFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
分类:Java 时间:2009-03-02 人气:459
分享到:
blog comments powered by Disqus

相关文章

  • Filter learning filter 2010-09-21

    ///////// Development of web applications, you can develop multiple filter, These filter can be achieved by one or a group of resources to access WEB intercept In order to achieve some special features. For example, the competence to achieve URL leve

  • Oracle select --------- having conditions where condition filter and filter 2010-06-28

    --------- Having conditions where condition filter and filter rows using the HAVING clause to select the GROUP BY clause HAVING clause to the set of conditions and the SELECT statement with WHERE clause similar to the way interaction. WHERE clause se

  • smtp protocol error message 2011-03-28

    smtp protocol error message 500 format error, command unrecognized (This error also includes the command line too long) Parameter format error 501 502 Command not achieve 503 Bad sequence of commands 504 Command parameter can not be achieved 211 Syst

  • Easily configure log4j, realize the error message email notification 2010-09-07

    http://www.java3z.com/cwbwebhome/article/article8/81366.html?id=3757 Requirement Description: Any program is still there bug, although the project after repeated testing, Yun Xing Yi Jing Shang line, but inevitably encounter various errors Hui, in th

  • ORACLE query appears "Ora-01791 is not a Selected Expression" error message solution (reprint) 2010-03-09

    Even writing a sales query function module, but when tested by bar code / code / sort the Treasury when the conditions are not wrong, just press the date when the investigation would have "Ora-01791 is not a Selected Expression" error message So

  • hibernate + mysql + ecliple first run error message 2010-04-07

    UserInfo class: // Persistent class information package hibernate.ch1; public class UserInfo { private Integer id; private String username; private String password; public Integer getId(){ return id; } public void setId(Integer id){ this.id=id; } pub

  • Apache will not start, error message: No space left on device ...... 2010-04-24

    Error message: [Wed Mar 11 15:57:46 2009] [crit] (28) No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Wed Mar 11 15:59:22 2009] [notice] suEXEC mechanism enabled (wrapper: / usr / sbin / suexec) [Wed Mar

  • Action to remove the residual Struts2 validation error message 2010-04-29

    Recently wrote a category management page, the category list and add the classification of the form placed in a page, and Action in the same set list () and add () methods are responsible for the classification list and add on Add Category The action

  • ROR function deployment process using debug error message appears when a large number of 2010-05-11

    Developed on rails in windows application, then all the way to unix on. Installation of rails in the environment when the reference robbin manner, almost no major problems. But the deployment of a problem after the operation: whether using mongrel or

  • ORACLE error message 2010-06-12

    00000,0, " Normal, complete success " 00001,0, " There are duplicate key index " 00017,0, " Request for a dialogue to set up accident " 00018,0, " Exceed the maximum number of sessions " 00019,0, " Exceed the m

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.160 (s). 12 q(s)