"Batch update returned unexpected row count from update" error in Crowd

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Operations will fail in applications using Crowd authentication, and upon further investigation the following error is logged in Crowd logs:

1 2 3 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

1 2 3 4 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

  1. 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.

  2. If the errors continue, create two different application contexts in Crowd for each of the JIRA applications.

  3. Update the MySQL JDBC driver: Connector\J 5.1 driver download

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.