SEVERE: Could not synchronize database state with session

这一生的挚爱 提交于 2020-03-20 13:49:08

问题


When trying to update an Entity in Hibernate Im getting this ERROR:

SEVERE: Could not synchronize database state with session

So the request is not being saved to database. My entity has many-to-one relationship.

What should I do?

org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.DataException: could not update: [org.game.model.HeroChampion#1234567]
    at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:634)
    at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:695)
    at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:566)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:540)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:510)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:310)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)

JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.DataException: could not update: 

Do I need to perform a session.refresh as stated in this post?

来源:https://stackoverflow.com/questions/60635336/severe-could-not-synchronize-database-state-with-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!