@Query("SELECT c FROM Catalog c WHERE c.id = :id")
@Lock(PESSIMISTIC_WRITE)
Optional<Catalog>findByIdWithLock(@Param("id")
String id)
Find a catalog by id with a pessimistic write lock. This will prevent other transactions from modifying the
catalog until the current transaction is complete.
Parameters:
id - the id of the catalog
Returns:
an Optional containing the catalog if found, or empty if not found