"Batch update returned unexpected row count from update" error in Crowd
Symptoms
Operations will fail in applications using Crowd authentication, and upon further investigation the following error is logged in Crowd logs:
com.atlassian.util.concurrent.LazyReference$InitializationException: org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReferen ce.java:152)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115)
or
2019-08-02 17:49:29,526 http-nio-8095-exec-25 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1], SQL: insert into cwd_property (property_value, property_key, property_name) values (?, ?, ?)
2019-08-02 17:49:29,528 http-nio-8095-exec-25 ERROR [org.hibernate.internal.ExceptionMapperStandardImpl] HHH000346: Error during managed flush [org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1]
2019-08-02 17:49:29,533 http-nio-8095-exec-25 INFO [crowd.xwork.interceptors.TransactionalInvocation] Invoking rollback for transaction on action '/console/setup/setupoptions.action (Options.execute())' due to throwable: org.springframework.orm.hibernate5.HibernateSystemException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1; nested exception is org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1
org.springframework.orm.hibernate5.HibernateSystemException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1; nested exception is org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 9; expected: 1
Cause
This error is typically caused by one of the following:
- MySQL is not configured with the required read-commit isolation parameter.
- You are using two versions of an application ( for example JIRA 3.13 and JIRA 4 ) using the same application ID in Crowd.
- MySQL JDBC driver
Resolution
- Verify your database is set up according to our setup documentation: Connecting Crowd to a Database
In MySQL, this error often occurs when the transaction-isolation is not set to READ-COMMITTED.
- If the errors continue, create two different application contexts in Crowd for each of the JIRA applications.
- Update the MySQL JDBC driver: Connector\J 5.1 driver download
Last modified on Aug 9, 2019
Powered by Confluence and Scroll Viewport.