It’s also possible to lock multiple rows at the same time, this can be done by executing a custom select query and setting the lock mode.

Exclusive lock table

@Query(value = "LOCK TABLE SKU IN EXCLUSIVE MODE", nativeQuery = true)
@Modifying
void lockTable();