SET ISOLATION statement
Derby Reference Manual
70
Only simple, single-table SELECT cursors can be updatable. The SELECT statement
for updatable ResultSets has the same syntax as the SELECT statement for updatable
cursors. To generate updatable cursors:
· The SELECT statement must not include an ORDER BY clause.
· The underlying Query must be a
.
in the underlying Query must not include:
· DISTINCT
· Aggregates
· GROUP BY clause
· HAVING clause
· ORDER BY clause
· The FROM clause in the underlying Query must not have:
· more than one table in its FROM clause
· anything other than one table name
·
· subqueries
· If the underlying Query has a WHERE clause, the WHERE clause must not have
subqueries.
Note: Cursors are read-only by default. To produce an updatable cursor besides
meeting the requirements listed above, the concurrency mode for the ResultSet must be
ResultSet.CONCUR_UPDATABLE
or the SELECT statement must have FOR UPDATE
in the FOR clause (see
There is no SQL language statement to assign a name to a cursor. Instead, one can use
the JDBC API to assign names to cursors or retrieve system-generated names. For more
information, see "Naming or accessing the name of a cursor" in the Derby Developer's
Guide.
Statement dependency system
The SELECT depends on all the tables and views named in the query and the
conglomerates (units of storage such as heaps and indexes) chosen for access paths
on those tables. CREATE INDEX does not invalidate a prepared SELECT statement.
A DROP INDEX statement invalidates a prepared SELECT statement if the index is
an access path in the statement. If the SELECT includes views, it also depends on the
dictionary objects on which the view itself depends (see
).
Any prepared UPDATE WHERE CURRENT or DELETE WHERE CURRENT statement
against a cursor of a SELECT depends on the SELECT. Removing a SELECT through
a java.sql.Statement.close request invalidates the UPDATE WHERE CURRENT or
DELETE WHERE CURRENT.
The SELECT depends on all aliases used in the query. Dropping an alias invalidates a
prepared SELECT statement if the statement uses the alias.
SET statements
Use the SET statements to set the current role, schema, or isolation level.
SET ISOLATION statement
The SET ISOLATION statement allows a user to change the isolation level for the user's
connection. Valid levels are SERIALIZABLE, REPEATABLE READ, READ COMMITTED,
and READ UNCOMMITTED.
Issuing this statement always commits the current transaction. The JDBC
java.sql.Connection.setTransactionIsolation method behaves almost identically to this
command, with one exception: if you are using the embedded driver, and if the call to
java.sql.Connection.setTransactionIsolation does not actually change the isolation level