We've had a number of support issues with this error in the logs:

      ERROR org.hibernate.event.def.AbstractFlushingEventListener: Could not synchronize database state with session
      org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

      The Crowd method which causes this error varies. I will link related support issues for dev review.

            [CWD-2703] Hibernate StaleStateExceptions in Crowd

            Monique Khairuliana (Inactive) made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 - restricted [ 1510861 ] New: JAC Bug Workflow v3 [ 3365310 ]
            Owen made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 [ 1391920 ] New: Simplified Crowd Development Workflow v2 - restricted [ 1510861 ]
            Owen made changes -
            Workflow Original: Crowd Development Workflow v2 [ 352077 ] New: Simplified Crowd Development Workflow v2 [ 1391920 ]
            Diego Berrueta made changes -
            Link New: This issue is related to CWD-3688 [ CWD-3688 ]

            Any solution?

            Fabrizio Galletti added a comment - Any solution?

            Ken Hill added a comment -

            Yes, this is still occurring in 2.7.0.

            Ken Hill added a comment - Yes, this is still occurring in 2.7.0.
            joe made changes -
            Link New: This issue has a regression in CWD-3688 [ CWD-3688 ]

            Faced with the same exceptions in 2.6.4. Is this bug present in Crowd 2.7?

            Oleksiy Brushkovskyy added a comment - Faced with the same exceptions in 2.6.4. Is this bug present in Crowd 2.7?

            April added a comment -

            We also have this with v2.6.4 (in brief):
            2013-09-03 17:49:39,685 http-8443-10 ERROR [org.hibernate.jdbc.AbstractBatcher] Exception executing batch:
            org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
            ...
            2013-09-03 17:49:39,687 http-8443-10 ERROR [hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
            org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
            ...
            2013-09-03 17:49:39,689 http-8443-10 ERROR [[Catalina].[localhost].[/crowd].[default]] Servlet.service() for servlet default threw exception
            org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
            ...
            2013-09-03 17:49:39,692 http-8443-10 ERROR [500ErrorPage] Exception caught in 500 page Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
            org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

            April added a comment - We also have this with v2.6.4 (in brief): 2013-09-03 17:49:39,685 http-8443-10 ERROR [org.hibernate.jdbc.AbstractBatcher] Exception executing batch: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1 ... 2013-09-03 17:49:39,687 http-8443-10 ERROR [hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1 ... 2013-09-03 17:49:39,689 http-8443-10 ERROR [ [Catalina] . [localhost] . [/crowd] . [default] ] Servlet.service() for servlet default threw exception org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1 ... 2013-09-03 17:49:39,692 http-8443-10 ERROR [500ErrorPage] Exception caught in 500 page Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1 org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0] ; actual row count: 0; expected: 1

            This might not actually be the same root cause identified here. I'll work through and comment again if this needs further attention.

            Ryan Goodwin (Inactive) added a comment - This might not actually be the same root cause identified here. I'll work through and comment again if this needs further attention.

              justin@atlassian.com Justin Koke
              13e918c6b49b José M. Arnesto
              Affected customers:
              3 This affects my team
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: