Package org.apache.derby.impl.drda
Class PiggyBackedSessionData
java.lang.Object
org.apache.derby.impl.drda.PiggyBackedSessionData
Tracks the most recently piggy-backed session attributes, and provides
methods to determine if they have been modified and need to be re-sent
to the client.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EngineConnection
private int
private boolean
private String
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Constructs a new instance with an associated EngineConnection. -
Method Summary
Modifier and TypeMethodDescriptionstatic PiggyBackedSessionData
getInstance
(PiggyBackedSessionData existing, EngineConnection conn, boolean createOnDemand) Get a reference (handle) to the PiggyBackedSessionData object.int
getIso()
boolean
boolean
boolean
void
refresh()
Refresh with the latest session attribute values from the connection.void
Clear the modified status.toString()
-
Field Details
-
iso_
private int iso_ -
isoMod_
private boolean isoMod_ -
schema_
-
schemaMod_
private boolean schemaMod_ -
conn_
-
-
Constructor Details
-
PiggyBackedSessionData
Constructs a new instance with an associated EngineConnection. A newly constructed instance is invalid. refresh() must be called before the xModified() methods can be used.- Parameters:
conn
- the connection to obtain data from
-
-
Method Details
-
getInstance
public static PiggyBackedSessionData getInstance(PiggyBackedSessionData existing, EngineConnection conn, boolean createOnDemand) throws SQLException Get a reference (handle) to the PiggyBackedSessionData object. Null will be returned either if the conn argument is not valid, or if the createOnDemand argument is false and the existing argument is null.- Parameters:
existing
- the PBSD object from the previous piggybacking or null if none has yet taken placeconn
- the current EngineConnectioncreateOnDemand
- if true; create the instance when needed- Returns:
- a reference to the PBSD object or null
- Throws:
SQLException
-
refresh
Refresh with the latest session attribute values from the connection. Any changes will be reflected in the corresponding xModified() methods, until setUnmodified() is called.- Throws:
SQLException
-
setUnmodified
public void setUnmodified()Clear the modified status. Called after session attributes have been sent to the client so that the xModified methods will return false. -
isIsoModified
public boolean isIsoModified()- Returns:
- true if the isolation level was modified by the last call to fetchLatest
-
isSchemaModified
public boolean isSchemaModified()- Returns:
- true if the current schema name was modified by the last call to fetchLatest
-
isModified
public boolean isModified()- Returns:
- true if any piggy-backed session attribute was modified by the last call to fetchLatest
-
getIso
public int getIso()- Returns:
- the saved jdbc isolation level
-
getSchema
- Returns:
- the saved schema name
-
toString
-