org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

Hibernate JIRA | Sascha v. Zitzewitz | 1 decade 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

    Hi, just wanted to let you know, that CollectionTest/testUpdateOrder (Hibernate unit tests) fails with the above config. I am getting the following exception. Maybe we have an JDBC issue here, but I am not deep enough in it yet. 18:26:58,760 WARN JDBCExceptionReporter:57 - SQL Error: 1210, SQLState: HY000 18:26:58,760 ERROR JDBCExceptionReporter:58 - Incorrect arguments to mysql_stmt_execute 18:26:58,770 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92) at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:161) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at org.hibernate.test.collection.CollectionTest.testUpdateOrder(CollectionTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at org.hibernate.test.TestCase.runTest(TestCase.java:129) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused by: java.sql.BatchUpdateException: Incorrect arguments to mysql_stmt_execute at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:828) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154) ... 34 more

    Hibernate JIRA | 1 decade ago | Sascha v. Zitzewitz
    org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
  2. 0

    Hi, just wanted to let you know, that CollectionTest/testUpdateOrder (Hibernate unit tests) fails with the above config. I am getting the following exception. Maybe we have an JDBC issue here, but I am not deep enough in it yet. 18:26:58,760 WARN JDBCExceptionReporter:57 - SQL Error: 1210, SQLState: HY000 18:26:58,760 ERROR JDBCExceptionReporter:58 - Incorrect arguments to mysql_stmt_execute 18:26:58,770 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92) at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:161) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at org.hibernate.test.collection.CollectionTest.testUpdateOrder(CollectionTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at org.hibernate.test.TestCase.runTest(TestCase.java:129) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused by: java.sql.BatchUpdateException: Incorrect arguments to mysql_stmt_execute at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:828) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154) ... 34 more

    Hibernate JIRA | 1 decade ago | Sascha v. Zitzewitz
    org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Hibernate mapping OneToMany through Annotation

    Stack Overflow | 4 years ago | Vijay
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

    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. java.sql.BatchUpdateException

      Incorrect arguments to mysql_stmt_execute

      at com.mysql.jdbc.ServerPreparedStatement.executeBatch()
    2. MySQL jdbc
      ServerPreparedStatement.executeBatch
      1. com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:828)
      1 frame
    3. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
      2. org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154)
      3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
      4. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
      4 frames
    4. Hibernate
      SessionImpl.managedFlush
      1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
      2. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      3. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
      4. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
      4 frames
    5. Hibernate
      JDBCTransaction.commit
      1. org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
      1 frame
    6. org.hibernate.test
      CollectionTest.testUpdateOrder
      1. org.hibernate.test.collection.CollectionTest.testUpdateOrder(CollectionTest.java:100)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    8. JUnit
      TestCase.runTest
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      1 frame
    9. org.hibernate.test
      TestCase.runTest
      1. org.hibernate.test.TestCase.runTest(TestCase.java:129)
      1 frame
    10. JUnit
      TestRunner.doRun
      1. junit.framework.TestCase.runBare(TestCase.java:127)
      2. junit.framework.TestResult$1.protect(TestResult.java:106)
      3. junit.framework.TestResult.runProtected(TestResult.java:124)
      4. junit.framework.TestResult.run(TestResult.java:109)
      5. junit.framework.TestCase.run(TestCase.java:118)
      6. junit.framework.TestSuite.runTest(TestSuite.java:208)
      7. junit.framework.TestSuite.run(TestSuite.java:203)
      8. junit.framework.TestSuite.runTest(TestSuite.java:208)
      9. junit.framework.TestSuite.run(TestSuite.java:203)
      10. junit.textui.TestRunner.doRun(TestRunner.java:116)
      10 frames
    11. com.intellij.rt
      IdeaJUnitAgent.doRun
      1. com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
      1 frame
    12. JUnit
      TestRunner.start
      1. junit.textui.TestRunner.start(TestRunner.java:172)
      1 frame
    13. IDEA
      TextTestRunner2.startRunnerWithArgs
      1. com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
      1 frame
    14. com.intellij.rt
      JUnitStarter.main
      1. com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
      2. com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
      2 frames
    15. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    16. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      1 frame