public interface SQLSessionContext
Presently this set contains the following properties:
SQL session context is implemented as follows: Statements at root connection level use the instance held by the the lcc, nested connections maintain instances of SQLSessionContext, held by the activation of the calling statement. This forms a logical stack as required by the standard. The statement context also holds a reference to the current SQLSessionContext.
When a dynamic result set references e.g. current role, the value retrieved will always be that of the current role when the statement is logically executed (inside procedure/function), not the current value when the result set is accessed outside the stored procedure/function. This works since the nested SQL session context is kept by the caller activation, so even though the statement context of the call has been popped, we can get at the final state of the nested SQL session context since the caller's activation is alive as long as dynamic result sets need it).
If more than one nested connection is used inside a shared procedure, they will share the same nested SQL session context. Since the same dynamic call context is involved, this seems correct.
Modifier and Type | Method and Description |
---|---|
java.util.HashMap<UUID,java.lang.Boolean> |
getConstraintModes()
Get a handle to the session's constraint modes.
|
java.lang.String |
getCurrentUser()
Get the SQL current user of this SQL connection context
|
SchemaDescriptor |
getDefaultSchema()
Get the schema of this SQL connection context
|
java.lang.Boolean |
getDeferredAll()
Get state of DEFERRED ALL setting.
|
java.lang.String |
getRole()
Get the SQL role of this SQL connection context
|
java.lang.Boolean |
isDeferred(UUID constraintId)
Return
Boolean.TRUE if the constraint mode for this
constraint/index has been set to deferred, Boolean.FALSE if
it has been set to immediate. |
void |
resetConstraintModes()
Clear deferred information for this transaction.
|
void |
setConstraintModes(java.util.HashMap<UUID,java.lang.Boolean> hm)
Initialize a inferior session context with the constraint mode map
of the parent session context.
|
void |
setDefaultSchema(SchemaDescriptor sd)
Set the schema of this SQL connection context
|
void |
setDeferred(UUID constraintId,
boolean deferred)
Set the constraint mode for this constraint to
deferred . |
void |
setDeferredAll(java.lang.Boolean deferred)
Set the constraint mode for all deferrable constraints to
deferred . |
void |
setRole(java.lang.String role)
Set the SQL role of this SQL connection context
|
void |
setUser(java.lang.String user)
Set the SQL current user of this SQL connection context
|
void setRole(java.lang.String role)
java.lang.String getRole()
void setUser(java.lang.String user)
java.lang.String getCurrentUser()
void setDefaultSchema(SchemaDescriptor sd)
SchemaDescriptor getDefaultSchema()
java.util.HashMap<UUID,java.lang.Boolean> getConstraintModes()
void setConstraintModes(java.util.HashMap<UUID,java.lang.Boolean> hm)
hm
- constraint mode mapvoid setDeferred(UUID constraintId, boolean deferred)
deferred
.
If deferred
is false
, to immediate checking,
if true
to deferred checking.constraintId
- The constraint iddeferred
- The new constraint modejava.lang.Boolean isDeferred(UUID constraintId)
Boolean.TRUE
if the constraint mode for this
constraint/index has been set to deferred, Boolean.FALSE
if
it has been set to immediate. Any ALL setting is considered also.
If the constraint mode hasn't been set for this constraint,
return null
. The constraint mode is the effectively the initial
constraint mode in this case.constraintId
- the constraint idBoolean.TRUE
if the constraint mode for this
constraint/index has been set to deferred, Boolean.FALSE
if
it has been set to immediate.void resetConstraintModes()
void setDeferredAll(java.lang.Boolean deferred)
deferred
.
If deferred
is false
, set to immediate checking,
if true
to deferred checking.
null
is allowed: it means no ALL setting exists.deferred
- the mode to setjava.lang.Boolean getDeferredAll()
True
is deferred all constraint mode has been
set for this session context.
False
is deferred immediate has been set for this
session context.
null
means no ALL setting has been made for this contextApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.