Hibernate 删除指定行的时候出现:
Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
在stactoverflow上面看到相关解答:
Your problem is that the object you previously loaded still exists in you hibernate session. I see two ways to cope with that.
1.) tell the hibernate session to merge your modified object with the one in the session
session.merge(object)
2.) kick the old object out of the session before writing the updated object to the session. session.clear() might work.
意思是说之前load的object在hibernate session中还存在。
在删除操作之前,加上session.clear(),然后就可以了。
分享到:
相关推荐
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...
weblogic12 下最新 org.hibernate.hql.ast.HqlToken解决办法
hibernate-validator 5.3.5.Final jar包 ;desc:if you want validator your project
Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开...
Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index...
No Hibernate Session bound to thread,没有绑定线程解决办法,找了好久才找到的
包含hibernate所有所需jar包还有一些其他包日志包、jpa支持包等: 列如:hibernate-core-5.1.0.Final.jar hibernate-ehcache-5.1.0.Final.jar hibernate-entitymanager-5.1.0.Final.jar hibernate-envers-5.1.0....
内含hibernate3.2与修复java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V 的错误的cglib2.2
整合了hibernate所需的全套jar包包括日志jar包以及mysql的连接jar包,希望对大家有所帮助
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....
基于hibernate的开源通用查询框架: 1.支持全部hql语法 2.可以支持Ajax用的 xml数据结构,也可以支持jsp、jstl、struts等标签,根据配置不同的数据解析器,得到不同结构的数据。 3.集成完整的分页功能。 4....
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.... ...
零基础学Java.Web开发:JSP.Servlet.Struts.Spring.Hibernate.Ajax(PPT).
hibernate3全部jar包:hibernate3.jar.zip 下载,保证好用
hibernate-release-5.0.7.Final的源码,有需要的人可以下载
myeclipse的自带hibernate jar包不支持注解;自己找的hibernate注解所需的jar包:hibernate-core;hibernate-annotation;hbm-cfg-xml;log4j.properties
SQLServer2008Dialect 优化了原来的分页查询数据方法以及在生成SQL时表后增加了with(nolock)
hibernate-validator-6.0.14.Final.jar
2.2、打开此文件,将“<property name="hibernate.connection.url">jdbc:sqlite:D:/EGSDatabase.egsdata”一行中的数据库文件("D:/EGSDatabase.egsdata")修改为合适的数据库文件。 注:附件包含了...