Example usage for javax.persistence LockModeType PESSIMISTIC_WRITE

List of usage examples for javax.persistence LockModeType PESSIMISTIC_WRITE

Introduction

In this page you can find the example usage for javax.persistence LockModeType PESSIMISTIC_WRITE.

Prototype

LockModeType PESSIMISTIC_WRITE

To view the source code for javax.persistence LockModeType PESSIMISTIC_WRITE.

Click Source Link

Document

Pessimistic write lock.

Usage

From source file:nu.yona.server.subscriptions.entities.UserRepository.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
@Query("select u from User u where u.id = :id")
User findOneForUpdate(@Param("id") UUID id);

From source file:org.wallride.repository.MediaRepository.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
Media findOneForUpdateById(String id);

From source file:org.wallride.repository.UserInvitationRepository.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
UserInvitation findOneForUpdateByToken(String token);

From source file:org.wallride.repository.TagRepository.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
Tag findOneForUpdateByIdAndLanguage(Long id, String language);

From source file:org.terasoluna.tourreservation.domain.repository.reserve.ReserveRepository.java

@Query("SELECT r FROM Reserve r WHERE r.reserveNo = :reserveNo")
@Lock(LockModeType.PESSIMISTIC_WRITE)
Reserve findOneForUpdate(@Param("reserveNo") String reserveNo);

From source file:org.wallride.repository.BlogRepository.java

@EntityGraph(value = Blog.DEEP_GRAPH_NAME, type = EntityGraph.EntityGraphType.FETCH)
@Lock(LockModeType.PESSIMISTIC_WRITE)
Blog findOneForUpdateById(Long id);

From source file:com.teradata.benchto.service.repo.BenchmarkRunRepo.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
BenchmarkRun findForUpdateByUniqueNameAndSequenceId(String uniqueName, String sequenceId);

From source file:com.ushahidi.swiftriver.core.api.dao.impl.JpaSequenceDao.java

/**
 * Override to obtain a pessimistic lock on the entity.
 * //from w  w  w  .j  av a  2 s .c  o  m
 * @param id
 * @return
 */
@Override
public Sequence findById(Object id) {
    return (Sequence) em.find(Sequence.class, id, LockModeType.PESSIMISTIC_WRITE);
}

From source file:org.wallride.repository.CommentRepository.java

@EntityGraph(value = Comment.DEEP_GRAPH_NAME, type = EntityGraph.EntityGraphType.FETCH)
@Lock(LockModeType.PESSIMISTIC_WRITE)
Comment findOneForUpdateById(Long id);

From source file:com.chessix.vas.db.AccountRepository.java

@Lock(LockModeType.PESSIMISTIC_WRITE)
Account findByClasAndExternalId(final CLAS clas, final String externalId);