hibernate错误同session不同实体
2007-08-25 09:15
183 查看
a different object with the same identifier value was already associated with the session 因为在hibernate中同一个session里面有了两个相同标识但是是不同实体
可以用session.merge解决;
或者 Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
session.clear();
session.update(user);
可以用session.merge解决;
或者 Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
session.clear();
session.update(user);
相关文章推荐
- hibernate错误同session不同实体
- 使用saveOrUpdate方法时,若hibernate的session存在了两个具有相同id的不同实体,则会报错
- 在hibernate中同一个session里面有了两个相同标识但是是不同实体。
- hibernate 3.2新的Session接口与之前接口的不同
- 今天出现这个错误:'sessionFactory' or 'hibernateTemplate' is required
- 解决Hibernate中不同包内有形同实体导致映射失败的问题
- 用Hibernate开发遇到"No CurrentSessionContext configured"错误
- Hibernate查询之SQL查询,查询结果用new新对象的方式接受,hql查询,通过SQL查询的结果返回到一个实体中,查询不同表中内容,并将查到的不同表中的内容放到List中
- java开源框架集成常见错误之No Hibernate Session bound to thread
- hibernate3和4中 HibernateSessionFactory中不同之处 The method applySettings(Map) from the type ServiceRegistryBuilder is deprecated - The type ServiceRegistryBuilder is deprecated
- 你不能不知道hibernate 3.2新的Session接口与之前接口的不同
- No CurrentSessionContext configured"错误(hibernate
- hibernate3中出现 could not initialize proxy - no Session 错误的解决办法以及lazy load的介绍
- a different object with the same identifier value was already associated with the session 一个经典的hibernate错误
- hibernate.properties not found(导致Configured SessionFactory: null 错误)
- Hibernate查询之SQL查询,查询结果用new新对象的方式接受,hql查询,通过SQL查询的结果返回到一个实体中,查询不同表中内容,并将查到的不同表中的内容放到List中
- hibernate中一种导致a different object with the same identifier value was already associated with the session错误方式及解决方法
- "No CurrentSessionContext configured"错误(hibernate)
- hibernate错误:org.hibernate.SessionException: Session was already closed
- 【Hibernate】配置错误The content of element type "session-factory".......