Uploaded image for project: 'Hibernate ORM'
  1. HHH-12464

NPE upon insert & delete with identity generated id

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 5.3.0.CR2
    • Fix versions: 5.3.0.CR2
    • Components: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When an entity with generated id is inserted and deleted in the same transaction and flush mode is set to COMMIT, NPE is thrown:

      java.lang.NullPointerException
      	at org.hibernate.action.internal.EntityAction.getId(EntityAction.java:100)
      	at org.hibernate.action.internal.EntityDeleteAction.postDelete(EntityDeleteAction.java:149)
      	at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:122)
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:478)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:356)
      	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
      	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)
      	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:494)
      	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3259)
      	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2457)
      	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:473)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:178)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:39)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:271)
      	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:86)
      

      Attaching reproducer (fails with master = 5.3.0-SNAPSHOT, rev. 69000ddc165ca0aba13ac950b2637974e018c4fb).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: