background image
<< SET ISOLATION statement | SET SCHEMA statement >>

set isolation serializable

<< SET ISOLATION statement | SET SCHEMA statement >>
Derby Reference Manual
71
(that is, if it sets the isolation level to its current value), the current transaction is not
committed.
For information about isolation levels, see "Locking, concurrency,
and isolation" in the Derby Developer's Guide. For information about
the JDBC java.sql.Connection.setTransactionIsolation method, see
java.sql.Connection.setTransactionIsolation method
.
Syntax
SET [ CURRENT ] ISOLATION [ = ]
{
UR | DIRTY READ | READ UNCOMMITTED
CS | READ COMMITTED | CURSOR STABILITY
RS |
RR | REPEATABLE READ | SERIALIZABLE
RESET
}
Example
set isolation serializable;
SET ROLE statement
The SET ROLE statement allows you to set the current role for the current SQL context
of a session.
You can set a role only if the current user has been granted the role, or if the role has
been granted to PUBLIC.
For more information on roles, see "Using SQL roles" in the Derby Developer's Guide.
Syntax
SET ROLE {
roleName
| 'string-constant' | ? | NONE }
If you specify a roleName of NONE, the effect is to unset the current role.
If you specify the role as a string constant or as a dynamic parameter specification (
?
),
any leading and trailing blanks are trimmed from the string before attempting to use the
remaining (sub)string as a roleName. The dynamic parameter specification can be used
in prepared statements, so the SET ROLE statement can be prepared once and then
executed with different role values. You cannot specify NONE as a dynamic parameter.
Setting a role identifies a set of privileges that is a union of the following:
· The privileges granted to that role
· The union of privileges of roles contained in that role (for a definition of role
containment, see "Syntax for roles" in
GRANT statement
)
In a session, the current privileges define what the session is allowed to access. The
current privileges are the union of the following:
· The privileges granted to the current user
· The privileges granted to PUBLIC
· The privileges identified by the current role, if set
The SET ROLE statement is not transactional; a rollback does not undo the effect of
setting a role. If a transaction is in progress, an attempt to set a role results in an error.
Examples
SET ROLE reader;