org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item

Hibernate JIRA | Christian Bauer | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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}

    Hibernate JIRA | 4 years ago | Christian Bauer
    org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item
  2. 0

    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}

    Hibernate JIRA | 4 years ago | Christian Bauer
    org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item

    Root Cause Analysis

    1. org.hibernate.AssertionFailure

      Unable to perform un-delete for instance org.jpwh.model.simple.Item

      at org.hibernate.engine.spi.ActionQueue.unScheduleDeletion()
    2. Hibernate
      SessionImpl.persist
      1. org.hibernate.engine.spi.ActionQueue.unScheduleDeletion(ActionQueue.java:527)
      2. org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:158)
      3. org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
      4. org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:854)
      5. org.hibernate.internal.SessionImpl.persist(SessionImpl.java:828)
      6. org.hibernate.internal.SessionImpl.persist(SessionImpl.java:832)
      6 frames
    3. org.hibernate.jpa
      AbstractEntityManagerImpl.persist
      1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1022)
      1 frame