Package org.apache.derby.impl.drda
Class PiggyBackedSessionData
- java.lang.Object
-
- org.apache.derby.impl.drda.PiggyBackedSessionData
-
class PiggyBackedSessionData extends java.lang.ObjectTracks 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
Fields Modifier and Type Field Description private EngineConnectionconn_private intiso_private booleanisoMod_private java.lang.Stringschema_private booleanschemaMod_
-
Constructor Summary
Constructors Modifier Constructor Description privatePiggyBackedSessionData(EngineConnection conn)Constructs a new instance with an associated EngineConnection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PiggyBackedSessionDatagetInstance(PiggyBackedSessionData existing, EngineConnection conn, boolean createOnDemand)Get a reference (handle) to the PiggyBackedSessionData object.intgetIso()java.lang.StringgetSchema()booleanisIsoModified()booleanisModified()booleanisSchemaModified()voidrefresh()Refresh with the latest session attribute values from the connection.voidsetUnmodified()Clear the modified status.java.lang.StringtoString()
-
-
-
Field Detail
-
iso_
private int iso_
-
isoMod_
private boolean isoMod_
-
schema_
private java.lang.String schema_
-
schemaMod_
private boolean schemaMod_
-
conn_
private final EngineConnection conn_
-
-
Constructor Detail
-
PiggyBackedSessionData
private PiggyBackedSessionData(EngineConnection conn)
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 Detail
-
getInstance
public static PiggyBackedSessionData getInstance(PiggyBackedSessionData existing, EngineConnection conn, boolean createOnDemand) throws java.sql.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:
java.sql.SQLException
-
refresh
public void refresh() throws java.sql.SQLExceptionRefresh with the latest session attribute values from the connection. Any changes will be reflected in the corresponding xModified() methods, until setUnmodified() is called.- Throws:
java.sql.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
public java.lang.String getSchema()
- Returns:
- the saved schema name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-