To handle optimistic locking in Spring Data JPA entities, you can use the _____ annotation on a version field.

  • @LockVersion
  • @Optimistic
  • @OptimisticLocking
  • @Version
To handle optimistic locking in Spring Data JPA entities, you can use the @Version annotation on a version field within your entity class. This allows Spring Data JPA to automatically manage and increment the version number of an entity during updates. Optimistic locking ensures that conflicts are detected when multiple users attempt to update the same entity concurrently, preventing data corruption.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *