Skip to content

Instantly share code, notes, and snippets.

@dev-aritra
Created May 15, 2021 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dev-aritra/1e4a93d3d8ef7a484ccb61b8246d49ff to your computer and use it in GitHub Desktop.
Save dev-aritra/1e4a93d3d8ef7a484ccb61b8246d49ff to your computer and use it in GitHub Desktop.
@Query(value = "select * from products where id = ?1 for update", nativeQuery = true)
Optional<Product> findByIdWithWriteLock(Long productId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment