现在的位置: 首页 > 综合 > 正文

Could not synchronize database state with session : Could not execute JDBC batch update

2013年08月23日 ⁄ 综合 ⁄ 共 598字 ⁄ 字号 评论关闭

org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
 at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:624)

12:37:46,796 ERROR AbstractFlushingEventListener:301 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

Caused by: java.sql.BatchUpdateException: null,  message from server: "Duplicate entry 'j2ee fans' for key 1"

 

解决方法:

查看添加的对象主键是否唯一

抱歉!评论已关闭.