首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

hibernate的top vote bug被小弟我遇到了

2012-10-07 
hibernate的top vote bug被我遇到了(lazy) m:n relation + EventListener AssertionFailure: collection

hibernate的top vote bug被我遇到了
(lazy) m:n relation + EventListener = AssertionFailure: collection [n-side] was not processed by flush()


链接:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2763


hibernate的event系统和它原有的机制有点区别.....如果想通过preUpdate or PostUpdate去修改原先的值,还是不要了,因为这样lazy就不能用了.....

这哥们总结的好:
My conclusion was, that you have not to change the state of the current object in the current session within events.
But if you want only use changed attributes - use the findDirty() (ore something called like this)(实际上是getOldState()) to touch only changed (and loaded) attributes.

热点排行