Error: "OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)" when importing AD users
search cancel

Error: "OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)" when importing AD users

book

Article ID: 400136

calendar_today

Updated On: 06-06-2025

Products

Data Loss Prevention Core Package

Issue/Introduction

Seeing the following error when importing users from AD

Level: SEVERE
Source: com.vontu.enforce.domainlayer.datauser.source.DataUserSyncTask
Message: User Synchronization failed:
Cause:
javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.vontu.enforceentities.users.ProtectUser#121]javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.vontu.enforceentities.users.ProtectUser#121]
    at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:223)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:93)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)

Cause

The AD import was conflicting with an active locked user

Resolution

The DLP API was regularly being called. It was called so often that a call occured during the import process and caused this error. After disabling the API scripts (Ran once every minute) the AD import worked as expected.