Delphi / Object Pascal · Database exception

dbExpress OptimisticLockFailed Error

What does dbExpress OptimisticLockFailed Error mean in Delphi / Object Pascal?

Returned when an optimistic-locking update conflict is detected because the row being updated was already changed or deleted by another session since it was read. The Oracle driver reports this specifically via the underlying 'OCI-21700: object does not exist or is marked for delete' condition.

dbExpress OptimisticLockFailed ErrorDelphi (VCL) · Delphi (FireMonkey) · Delphi (dbExpress)

Condition

Returned when an optimistic-locking update conflict is detected because the row being updated was already changed or deleted by another session since it was read. The Oracle driver reports this specifically via the underlying 'OCI-21700: object does not exist or is marked for delete' condition.

Fix

Re-fetch the current row and let the user decide how to merge or reapply their change, rather than blindly retrying the same update, since the record's state has genuinely moved since it was loaded.

Related database exception