Class PiggyBackedSessionData

java.lang.Object
org.apache.derby.impl.drda.PiggyBackedSessionData

class PiggyBackedSessionData extends Object
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 Details

    • iso_

      private int iso_
    • isoMod_

      private boolean isoMod_
    • schema_

      private String schema_
    • schemaMod_

      private boolean schemaMod_
    • conn_

      private final EngineConnection conn_
  • Constructor Details

    • 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 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 place
      conn - the current EngineConnection
      createOnDemand - if true; create the instance when needed
      Returns:
      a reference to the PBSD object or null
      Throws:
      SQLException
    • refresh

      public void refresh() throws SQLException
      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

      public String getSchema()
      Returns:
      the saved schema name
    • toString

      public String toString()
      Overrides:
      toString in class Object