org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 2; expected: 1

Stack Overflow | user1740005 | 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

    Save in one to many mapping in hibernate in updating instead of inserting

    Stack Overflow | 4 years ago | user1740005
    org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 2; expected: 1
  2. 0

    Hibernate Community • View topic - org.hibernate.jdbc.BatchedTooManyRowsAffectedException

    hibernate.org | 1 year ago
    org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 3; expected: 1

    Root Cause Analysis

    1. org.hibernate.jdbc.BatchedTooManyRowsAffectedException

      Batch update returned unexpected row count from update [0]; actual row count: 2; expected: 1

      at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched()
    2. Hibernate
      AbstractEntityPersister.update
      1. org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:71)
      2. org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
      3. org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:24)
      4. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2403)
      5. org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
      6. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
      6 frames
    3. Hibernate
      EntityUpdateAction.execute
      1. org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
      1 frame
    4. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
      2. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
      3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
      3 frames
    5. Hibernate
      SessionImpl.flush
      1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
      2. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      3. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
      3 frames