org.apache.derby.impl.drda
Class PiggyBackedSessionData

java.lang.Object
  extended by org.apache.derby.impl.drda.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 Summary
private  EngineConnection conn_
           
private  int iso_
           
private  boolean isoMod_
           
private  java.lang.String schema_
           
private  boolean schemaMod_
           
 
Constructor Summary
private PiggyBackedSessionData(EngineConnection conn)
          Constructs a new instance with an associated EngineConnection.
 
Method Summary
static PiggyBackedSessionData getInstance(PiggyBackedSessionData existing, EngineConnection conn, boolean createOnDemand)
          Get a reference (handle) to the PiggyBackedSessionData object.
 int getIso()
           
 java.lang.String getSchema()
           
 boolean isIsoModified()
           
 boolean isModified()
           
 boolean isSchemaModified()
           
 void refresh()
          Refresh with the latest session attribute values from the connection.
 void setUnmodified()
          Clear the modified status.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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)
                        throws java.sql.SQLException
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
Throws:
java.sql.SQLException
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

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.