Answer the question
In order to leave comments, you need to log in
Is it possible in MongoDb using spring data to make an analog of a pessimistic write lock?
Hello, before I change a record, I need to block all other records of one user. I tried to do it by analogy when working with Postgres.
@Repository
public interface UserRepository extends MongoRepository<User, UUID> {
@Transactional
@Lock(LockModeType.PESSIMISTIC_WRITE)
List<ProxyFarmCache> findAllById(UUID id);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question