Database deadlock on LDAP user since in RH-SSO

Solution Unverified - Updated -

Issue

  • Sync fails and database deadlocks with exception:

    KC-SERVICES0062: Error occurred during sync of changed users: javax.persistence.OptimisticLockException: org.hibernate.exception.LockAcquisitionException: could not execute query
        at org.hibernate.internal.ExceptionConverterImpl.wrapLockException(ExceptionConverterImpl.java:277)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:98)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
        at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1514)
        at org.hibernate.query.Query.getResultList(Query.java:135)
        at org.keycloak.models.jpa.UserAdapter.getRoleMappings(UserAdapter.java:468)
        at org.keycloak.models.jpa.UserAdapter.hasRole(UserAdapter.java:420)
        at org.keycloak.models.jpa.UserAdapter.grantRole(UserAdapter.java:434)
        at org.keycloak.models.utils.DefaultRoles.addDefaultRoles(DefaultRoles.java:48)
        at org.keycloak.models.jpa.JpaUserProvider.addUser(JpaUserProvider.java:105)
        at org.keycloak.models.jpa.JpaUserProvider.addUser(JpaUserProvider.java:125)
        at org.keycloak.storage.ldap.LDAPStorageProvider.importUserFromLDAP(LDAPStorageProvider.java:502)
    

Environment

  • Red Hat Single Sign-On (RH-SSO)
    • 7.3
  • Microsoft SQL Server
  • Java Database Connectivity (JDBC)
  • Lightweight Directory Access Protocol (LDAP) or Microsoft Active Directory (AD)
  • User sync

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content