@Deprecated public interface LockProvider
Select
statement) providing the possibility of
locking tables, rows using a FOR UPDATE
clauseModifier and Type | Method and Description | ||
---|---|---|---|
void |
setForShare(boolean forShare)
Deprecated.
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)
Deprecated.
Sets the "FOR UPDATE" flag onto the query
Native implementation This has been observed to be supported by
any of these dialects:
void setForUpdateNoWait()
Deprecated.
Some RDBMS allow for specifying the locking mode for the applied
FOR UPDATE clause. | ||
void |
setForUpdateOf(Collection<? extends Field<?>> fields)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Some RDBMS allow for specifying the tables that should be locked by the
FOR UPDATE clause, instead of the full row. |
||
void |
setForUpdateSkipLocked()
Deprecated.
Some RDBMS allow for specifying the locking mode for the applied
FOR UPDATE clause. |
||
void |
setForUpdateWait(int seconds)
Deprecated.
Some RDBMS allow for specifying the locking mode for the applied
FOR UPDATE clause. |
@Support(value={ASE,CUBRID,DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,MYSQL,ORACLE,POSTGRES,SQLSERVER,SYBASE}) void setForUpdate(boolean forUpdate)
FOR UPDATE
clause using a cursor. The cursor is handled by
the JDBC driver, at PreparedStatement
construction time, when
calling Connection.prepareStatement(String, int, int)
with
ResultSet.CONCUR_UPDATABLE
. jOOQ handles simulation of a
FOR UPDATE
clause using CONCUR_UPDATABLE
for
these dialects:
Note: This simulation may not be efficient for large result sets!
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 value@Support(value={DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,ORACLE,SYBASE}) void 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:
Note, that SQLDialect.DB2
has some stricter requirements
regarding the updatability of fields. Refer to the DB2 documentation for
further details
fields
- The fields that should be locked@Support(value={DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,ORACLE,SYBASE}) void setForUpdateOf(Collection<? extends Field<?>> fields)
FOR UPDATE
clause, instead of the full row.
setForUpdateOf(Field...)
@Support(value={DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,POSTGRES,ORACLE,SYBASE}) 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 locked@Support(value=ORACLE) void 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 lock@Support(value=ORACLE) void 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:
@Support(value=ORACLE) 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:
@Support(value={MYSQL,POSTGRES}) 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 valueCopyright © 2013. All Rights Reserved.