我在springsource community论坛里看到这个相关问题讨论和解决途径,不过都是英文的,给大家摘录一段: TO Rama: a masterly idea :-) I've resolved this problem! but I did not follow your idea, but thanks for your reply I switched my hibernate3.0 to hibernate 3.2.6 just as bdangubic said and it worked well 这哥们回复的大概意思是说,使用hibernate3.2.6替换了项目中的hibernate3.0,然后这个问题就解决了。可是我把项目中hibernate版本换掉之后,还是会出现这种问题,我现在项目框架采用的是Struts2.1+Spring3.0+hibernate3.1。因为论坛中没有提到项目除了hibernate做持久层,还是用其他什么架构,所以我现在也不敢随意揣摩。 如果大家有什么好的解决途径,希望慷慨分享一下哦!!
这个问题你最后怎么解决的?????我也遇到一个类似的问题,我的仓库表和备货表是一对多的关系,我的数据库里如果备货去的数据是空的的话,就可以查询出仓库的类容,如果我给备货区表添加数据后就查不出来了,,,还报错!!!!!!!!The server encountered an internal error () that prevented it from fulfilling this request.(这是网页上显示的错误信息)[org.hibernate.engine.loading.LoadContexts-132][http-8080-3][358229] - fail-safe cleanup (collections) : org.hibernate.engine.loading.CollectionLoadContext@3f2507<rs=oracle.jdbc.driver.OracleResultSetImpl@979ede> 09-0513:16:35[org.hibernate.engine.loading.CollectionLoadContext-348][http-8080-3][358230] - On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries 这是eclipse上显示的错误
TO Rama: a masterly idea :-) I've resolved this problem!
but I did not follow your idea, but thanks for your reply
I switched my hibernate3.0 to hibernate 3.2.6 just as bdangubic said and it worked well
这哥们回复的大概意思是说,使用hibernate3.2.6替换了项目中的hibernate3.0,然后这个问题就解决了。可是我把项目中hibernate版本换掉之后,还是会出现这种问题,我现在项目框架采用的是Struts2.1+Spring3.0+hibernate3.1。因为论坛中没有提到项目除了hibernate做持久层,还是用其他什么架构,所以我现在也不敢随意揣摩。
如果大家有什么好的解决途径,希望慷慨分享一下哦!!
原因就是在Hibernate3的事件处理过程中对原始数据进行了访问或处理,导致update与save产生冲突,如果原始数据不是对象而是Integer、String等常规数据类型是没有关系,一旦你调用了many-to-one或者one-to-many之类的就会抛这个异常出来。
所以我最后做日志的时候把many-to-one或者one-to-many的属性去掉不记录就没问题了!
system.out.println(com.iwork.basic.model.IOrganization.childOrg.size())
或者你直接输出它然后再存储,当然还有一种就是
09-0513:16:35[org.hibernate.engine.loading.CollectionLoadContext-348][http-8080-3][358230] - On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries
这是eclipse上显示的错误