|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LockProvider
A query part (mostly a Select
statement) providing the possibility of
locking tables, rows using a FOR UPDATE
clause
Method Summary | |||
---|---|---|---|
void |
setForShare(boolean forShare)
Sets the "FOR SHARE" flag onto the query This has been observed to be supported by any of these dialects: MySQL's InnoDB locking reads Postgres FOR UPDATE / FOR SHARE If your dialect does not support this clause, jOOQ will still render it, if you apply it to your query. |
||
void |
setForUpdate(boolean forUpdate)
Sets the "FOR UPDATE" flag onto the query This has been observed to be supported by any of these dialects: |
void |
setForUpdateNoWait()
Some RDBMS allow for specifying the locking mode for the applied FOR UPDATE clause. |
void |
setForUpdateOf(Collection<? extends Field<?>> fields)
Some RDBMS allow for specifying the fields that should be locked by the FOR UPDATE clause, instead of the full row. |
||
void |
setForUpdateOf(Field<?>... fields)
Some RDBMS allow for specifying the fields that should be locked by the FOR UPDATE clause, instead of the full row. |
||
void |
setForUpdateOf(Table<?>... tables)
Some RDBMS allow for specifying the tables that should be locked by the FOR UPDATE clause, instead of the full row. |
||
void |
setForUpdateSkipLocked()
Some RDBMS allow for specifying the locking mode for the applied FOR UPDATE clause. |
||
void |
setForUpdateWait(int seconds)
Some RDBMS allow for specifying the locking mode for the applied FOR UPDATE clause. |
Method Detail |
---|
void setForUpdate(boolean forUpdate)
This has been observed to be supported by any of these dialects:
These dialects are known not to support the FOR UPDATE
clause in regular SQL:
If your dialect does not support this clause, jOOQ will still render it, if you apply it to your query. This might then cause syntax errors reported either by your database or your JDBC driver.
You shouldn't combine this with setForShare(boolean)
forUpdate
- The flag's valuevoid setForUpdateOf(Field<?>... fields)
FOR UPDATE
clause, instead of the full row.
This automatically sets the setForUpdate(boolean)
flag, and
unsets the setForShare(boolean)
flag, if it was previously set.
This has been observed to be natively supported by any of these dialects:
fields
- The fields that should be lockedvoid setForUpdateOf(Collection<? extends Field<?>> fields)
FOR UPDATE
clause, instead of the full row.
setForUpdateOf(Field...)
void setForUpdateOf(Table<?>... tables)
FOR UPDATE
clause, instead of the full row.
This automatically sets the setForUpdate(boolean)
flag, and
unsets the setForShare(boolean)
flag, if it was previously set.
This has been observed to be natively supported by any of these dialects:
jOOQ simulates this by locking all known fields of [tables
]
for any of these dialects:
tables
- The tables that should be lockedvoid setForUpdateWait(int seconds)
FOR UPDATE
clause. In this case, the session will wait for
some seconds
, before aborting the lock acquirement if the
lock is not available.
This automatically sets the setForUpdate(boolean)
flag, and
unsets the setForShare(boolean)
flag, if it was previously set.
This has been observed to be supported by any of these dialects:
seconds
- The number of seconds to wait for a lockvoid setForUpdateNoWait()
FOR UPDATE
clause. In this case, the session will not wait
before aborting the lock acquirement if the lock is not available.
This automatically sets the setForUpdate(boolean)
flag, and
unsets the setForShare(boolean)
flag, if it was previously set.
This has been observed to be supported by any of these dialects:
void setForUpdateSkipLocked()
FOR UPDATE
clause. In this case, the session will skip all
locked rows from the select statement, whose lock is not available.
This automatically sets the setForUpdate(boolean)
flag, and
unsets the setForShare(boolean)
flag, if it was previously set.
This has been observed to be supported by any of these dialects:
void setForShare(boolean forShare)
This has been observed to be supported by any of these dialects:
If your dialect does not support this clause, jOOQ will still render it, if you apply it to your query. This might then cause syntax errors reported either by your database or your JDBC driver.
You shouldn't combine this with setForUpdate(boolean)
forShare
- The flag's value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |