List of usage examples for org.hibernate.jpa AvailableSettings LOCK_TIMEOUT
String LOCK_TIMEOUT
To view the source code for org.hibernate.jpa AvailableSettings LOCK_TIMEOUT.
Click Source Link
From source file:de.micromata.genome.jpa.Emgr.java
License:Apache License
/** * Set the the query to use select for update. * * @param query the query/*w w w . ja v a 2 s.c o m*/ * @param lockTimetimeInMs the lock timetime in ms */ @Override public void setSelectForUpdate(Query query, int lockTimetimeInMs) { query.setHint(AvailableSettings.LOCK_TIMEOUT, lockTimetimeInMs); setQueryTimeout(query, lockTimetimeInMs); query.setLockMode(LockModeType.PESSIMISTIC_WRITE); }