api-docs / org.ktorm.support.postgresql / locking
locking
fun Query.locking(
mode: LockingMode,
tables: List<BaseTable<*>> = emptyList(),
wait: LockingWait = WAIT
): Query
(source code)fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.locking(
mode: LockingMode,
tables: List<BaseTable<*>> = emptyList(),
wait: LockingWait = WAIT
): EntitySequence<E, T>
(source code)Specify the locking clause of this query, an example generated SQL could be:
select ... for update of table_name nowait
Parameters
mode
- locking mode, one of FOR_UPDATE, FOR_NO_KEY_UPDATE, FOR_SHARE, FOR_KEY_SHARE.
tables
- specific the tables, only rows coming from those tables would be locked.
wait
- waiting strategy, one of WAIT, NOWAIT, SKIP_LOCKED.
Since
3.4.0