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

Hibernate JIRA | Christian Bauer | 3 years ago
  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 | 3 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 | 3 years ago | Christian Bauer
    org.hibernate.AssertionFailure: Unable to perform un-delete for instance org.jpwh.model.simple.Item
  3. 0

    org.hibernate.AssertionFailure: Unable to perform un-delete for instance

    Stack Overflow | 4 years ago | oguz karakus
    org.hibernate.AssertionFailure: Unable to perform un-delete for instance X
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    EntityManager.remove isn't working with JPA+hibernate

    Stack Overflow | 3 years ago | user3332598
    javax.persistence.RollbackException: Error while committing the transaction
  6. 0

    Exception: Unable to determine collection owner identifier for orphan-delete processing

    Eclipse Bugzilla | 7 years ago | mtaal
    org.hibernate.AssertionFailure: Unable to determine collection owner identifier for orphan-delete processing

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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