Class PiggyBackedSessionData


  • class PiggyBackedSessionData
    extends java.lang.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 Detail

      • iso_

        private int iso_
      • isoMod_

        private boolean isoMod_
      • schema_

        private java.lang.String schema_
      • schemaMod_

        private boolean schemaMod_
    • 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 place
        conn - the current EngineConnection
        createOnDemand - 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.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:
        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:
        toString in class java.lang.Object