|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SQLSessionContext
An implementation of this interface encapsulates some of the SQL session context's state variables, cf. SQL 2003, section 4.37.3, notably those which we need to save and restore when entering a stored procedure or function (which can contain SQL and thus a nested connection), cf. 4.37.3, 4.27.3 and 4.34.1.1.
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.
LanguageConnectionContext.setupNestedSessionContext(org.apache.derby.iapi.sql.Activation)
Method Summary | |
---|---|
SchemaDescriptor |
getDefaultSchema()
Get the schema of this SQL connection context |
java.lang.String |
getRole()
Get the SQL role of this SQL connection context |
void |
setDefaultSchema(SchemaDescriptor sd)
Set the schema of this SQL connection context |
void |
setRole(java.lang.String role)
Set the SQL role of this SQL connection context The empty string is returned if role is NONE. |
Method Detail |
---|
void setRole(java.lang.String role)
java.lang.String getRole()
void setDefaultSchema(SchemaDescriptor sd)
SchemaDescriptor getDefaultSchema()
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |