org.hibernate.AssertionFailure

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The fix in HHH-5124 doesn't work for proxies: {code} Item item = em.getReference(Item.class, 123); em.remove(item); em.persist(item); {code} {code} main ] ERROR - 12:51:21,920 - org.hibernate.AssertionFailure: HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item at org.hibernate.engine.spi.ActionQueue.unScheduleDeletion(ActionQueue.java:527) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:158) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:854) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:828) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:832) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1022) {code} A related bug is enabled hibernate.use_identifier_rollback, then find() -> remove() -> persist() also doesn't work: {code} Caused by: org.hibernate.HibernateException: identifier of an instance of org.jpwh.model.simple.Item was altered from 1000 to null at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:82) at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:194) at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:156) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1235) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:405) {code}
    via by Christian Bauer,
  • The fix in HHH-5124 doesn't work for proxies: {code} Item item = em.getReference(Item.class, 123); em.remove(item); em.persist(item); {code} {code} main ] ERROR - 12:51:21,920 - org.hibernate.AssertionFailure: HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item at org.hibernate.engine.spi.ActionQueue.unScheduleDeletion(ActionQueue.java:527) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:158) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:854) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:828) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:832) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1022) {code} A related bug is enabled hibernate.use_identifier_rollback, then find() -> remove() -> persist() also doesn't work: {code} Caused by: org.hibernate.HibernateException: identifier of an instance of org.jpwh.model.simple.Item was altered from 1000 to null at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:82) at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:194) at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:156) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1235) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:405) {code}
    via by Christian Bauer,
    • org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item at org.hibernate.engine.spi.ActionQueue.unScheduleDeletion(ActionQueue.java:527) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:158) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:854) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:828) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:832) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1022)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,