Illegal attempt to associate a collection with two open session问题
2013-04-09 17:47
375 查看
在spring的HibernateTemplate中经常遇到这样的情况:
一个session 负责载入数据,另一个session 修改了这个数据
如果前一个session没有close的话,就会报标题的错误
解决方法是使用 hibernate的Merge函数
用这个函数代替Update,能将一个已经与session绑定的数据Update
一个session 负责载入数据,另一个session 修改了这个数据
如果前一个session没有close的话,就会报标题的错误
解决方法是使用 hibernate的Merge函数
用这个函数代替Update,能将一个已经与session绑定的数据Update
相关文章推荐
- Illegal attempt to associate a collection with two open session问题
- 异常描述:hibernate懒加载中,用OpenSessionInViewFilter解决之后,同时对一个collection创建两个session访问导致异常(Illegal attempt to associate a collection with two open sessions)
- OpenSessionInViewFilter的两个异常:Illegal attempt to associate a collection with two open sessions
- org.hibernate.HibernateException:Illegal attempt to associate a collection with two open sessions; 问题。
- Illegal attempt to associate a collection with two open session
- SSH架构中Illegal attempt to associate a collection with two open sessions 问题
- net.sf.hibernate.HibernateException: Illegal attempt to associate a collection with two open session
- Hibernate 错误:Illegal attempt to associate a collection with two open sessions
- 【Hibernate】Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions
- 解决HibernateException: Illegal attempt to associate a collection with two open sessions
- 解决HibernateException: Illegal attempt to associate a collection with two open sessions
- Hibernate 异常:Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions.
- Hibernate 异常: Illegal attempt to associate a collection with two open sessions
- Hibernate Merge (Illegal attempt to associate a collection with two open sessions)
- HibernateException: Illegal attempt to associate a collection with two open sessions
- HibernateException: Illegal attempt to associate a collection with two open sessions(解决方法)