Oracle Application Server TopLink API Reference
10g (9.0.4.3)

B10491-02

oracle.toplink.threetier
Class ClientSession

java.lang.Object
  extended byoracle.toplink.publicinterface.Session
      extended byoracle.toplink.threetier.ClientSession

All Implemented Interfaces:
java.lang.Cloneable, CommandProcessor, java.io.Serializable, Session

public class ClientSession
extends oracle.toplink.publicinterface.Session

Purpose: Acts as a client to the server session.

Description: This session is brokered by the server session for use in three-tiered applications. It is used to store the context of the connection, i.e. the login to be used for this cleint. This allows each client connected to the server to contain its own user login.

Responsibilities:

This class is an implementation of Session. Please refer to that class for a full API. The public interface should be used.

See Also:
Server, UnitOfWork, Serialized Form

Field Summary

 

Fields inherited from class oracle.toplink.publicinterface.Session
isInBroker, Logging, usesOldCommit

 

Fields inherited from interface oracle.toplink.remotecommand.CommandProcessor
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING

 

Constructor Summary
ClientSession(oracle.toplink.threetier.ServerSession parent, ConnectionPolicy connectionPolicy)
          INTERNAL: Create and return a new client session.

 

Method Summary
 void afterTransaction(boolean committed, boolean isExternalTransaction)
          INTERNAL: Called after transaction is completed (committed or rolled back)
 void basicBeginTransaction()
          INTERNAL: This is internal to the unit of work and should never be called otherwise.
 void basicCommitTransaction()
          INTERNAL: This is internal to the unit of work and should not be called otherwise.
 void basicRollbackTransaction()
          INTERNAL: This is internal to the unit of work and should not be called otherwise.
 void connect()
          INTERNAL: Connect the session only (this must be the write connection as the read is shared).
 boolean containsQuery(java.lang.String queryName)
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void disconnect()
          INTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared).
 oracle.toplink.internal.databaseaccess.Accessor getAccessor()
          INTERNAL: Return the read or write connection depending on the transaction state.
 CacheSynchronizationManager getCacheSynchronizationManager()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 CommandManager getCommandManager()
          INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink cluster
 ConnectionPolicy getConnectionPolicy()
          INTERNAL: Return the connection policy.
 java.util.Hashtable getDescriptors()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 oracle.toplink.internal.identitymaps.IdentityMapManager getIdentityMapManager()
          INTERNAL: required public for testing access.
 oracle.toplink.threetier.ServerSession getParent()
          INTERNAL: Return the parent.
 DatabaseQuery getQuery(java.lang.String name)
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 DatabaseQuery getQuery(java.lang.String name, java.util.Vector args)
          INTERNAL:
 oracle.toplink.internal.sequencing.Sequencing getSequencing()
          INTERNAL: Return the Sequencing object used by the session.
 oracle.toplink.internal.databaseaccess.Accessor getWriteConnection()
          INTERNAL: Return the connection to be used for database modification.
 boolean hasCacheSynchronizationManager()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void initializeAllIdentityMaps()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void initializeIdentityMap(java.lang.Class theClass)
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void initializeIdentityMaps()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void initializeSequencing()
          INTERNAL: was ADVANCED: Creates sequencing object for the session.
 java.lang.Object internalExecuteQuery(DatabaseQuery query, DatabaseRow databaseRow)
          INTERNAL: Return the results from exeucting the database query.
 boolean isActive()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 boolean isClientSession()
          INTERNAL: Return if this session is a client session.
 boolean isConnected()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void release()
          INTERNAL: Was PUBLIC: customer will be redirected to Session.
 void setWriteConnection(oracle.toplink.internal.databaseaccess.Accessor writeConnection)
          INTERNAL: Set the connection to be used for database modification.
 boolean shouldPropagateChanges()
          INTERNAL: Return whether changes should be propagated to TopLink cluster.
 java.lang.String toString()
          INTERNAL: Print the connection status with the session.

 

Methods inherited from class oracle.toplink.publicinterface.Session
acquireIdentityMapDeferredLock, acquireIdentityMapLock, acquireNonSynchronizedUnitOfWork, acquireUnitOfWork, addAlias, addAliasesFromProject, addQuery, beginTransaction, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitTransaction, compareObjects, compareObjectsDontMatch, containsObjectInIdentityMap, containsObjectInIdentityMap, copyObject, copyObject, copyReadOnlyClasses, decrementMergesPending, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, dontLogSQL, endOperationProfile, executeCall, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getAccessor, getAccessor, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllFromIdentityMap, getAllFromIdentityMap, getAllQueries, getBroker, getCommitManager, getDefaultReadOnlyClasses, getDescriptor, getDescriptor, getDescriptorForAlias, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExternalTransactionController, getExternalTransactionControllerClass, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMapWithDeferredLock, getIntegrityChecker, getLog, getLoggingStream, getLogin, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getPlatform, getPlatform, getProfiler, getProject, getProperties, getProperty, getQueries, getSessionForClass, getSessionLog, getTransactionMutex, getWrapper, getWriteLockValue, getWriteLockValue, handleException, hasBroker, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, incrementMergesPending, insertObject, isBroker, isClassReadOnly, isDatabaseSession, isDistributedSession, isInBroker, isInProfile, isInTransaction, isProxySession, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, log, logDebug, logDebug, logDebug, logDebug, logException, logMessage, logMessage, logMessage, logMessage, logMessage, logMessages, logSQL, mergesPending, printIdentityMap, printIdentityMaps, processCommand, putInIdentityMap, putInIdentityMap, putInIdentityMap, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, releaseUnitOfWork, removeFromIdentityMap, removeFromIdentityMap, removeProperty, removeQuery, removeQuery, rollbackTransaction, setAccessor, setAliasDescriptors, setBroker, setCacheSynchronizationManager, setCommandManager, setCommitManager, setEventManager, setExceptionHandler, setExceptionHandlerClass, setExternalTransactionController, setExternalTransactionControllerClass, setIntegrityChecker, setLog, setLoggingStream, setLogin, setName, setProfiler, setProject, setProperties, setProperty, setSessionLog, setShouldLogMessages, setShouldLogSQL, setShouldPropagateChanges, setUseOldCommit, setWasJTSTransactionInternallyStarted, setWrapper, shouldLogMessages, shouldLogMessages, shouldLogSQL, startOperationProfile, unwrapObject, updatedCacheKeyInIdentityMap, updateObject, updateWriteLockValue, updateWriteLockValue, usesExternalTransactionController, usesOldCommit, validateCache, verifyDelete, wasJTSTransactionInternallyStarted, wrapObject, writeObject

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ClientSession

public ClientSession(oracle.toplink.threetier.ServerSession parent,
ConnectionPolicy connectionPolicy)
INTERNAL: Create and return a new client session.
Method Detail

afterTransaction

public void afterTransaction(boolean committed,
                             boolean isExternalTransaction)
INTERNAL: Called after transaction is completed (committed or rolled back)
Overrides:
afterTransaction in class oracle.toplink.publicinterface.Session

basicBeginTransaction

public void basicBeginTransaction()
INTERNAL: This is internal to the unit of work and should never be called otherwise.

basicCommitTransaction

public void basicCommitTransaction()
INTERNAL: This is internal to the unit of work and should not be called otherwise.

basicRollbackTransaction

public void basicRollbackTransaction()
INTERNAL: This is internal to the unit of work and should not be called otherwise.

connect

public void connect()
             throws DatabaseException
INTERNAL: Connect the session only (this must be the write connection as the read is shared).
Throws:
DatabaseException

containsQuery

public boolean containsQuery(java.lang.String queryName)
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return true if the pre-defined query is defined on the session.
Specified by:
containsQuery in interface Session
Overrides:
containsQuery in class oracle.toplink.publicinterface.Session

disconnect

public void disconnect()
                throws DatabaseException
INTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared).
Throws:
DatabaseException

getAccessor

public oracle.toplink.internal.databaseaccess.Accessor getAccessor()
INTERNAL: Return the read or write connection depending on the transaction state.
Overrides:
getAccessor in class oracle.toplink.publicinterface.Session

getCacheSynchronizationManager

public CacheSynchronizationManager getCacheSynchronizationManager()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Returns the Synchronization Policy for this session.
Specified by:
getCacheSynchronizationManager in interface Session
Overrides:
getCacheSynchronizationManager in class oracle.toplink.publicinterface.Session

getConnectionPolicy

public ConnectionPolicy getConnectionPolicy()
INTERNAL: Return the connection policy.

getDescriptors

public java.util.Hashtable getDescriptors()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return all registered descriptors. The clients session inherits its parent's descriptors.
Specified by:
getDescriptors in interface Session
Overrides:
getDescriptors in class oracle.toplink.publicinterface.Session

getIdentityMapManager

public oracle.toplink.internal.identitymaps.IdentityMapManager getIdentityMapManager()
INTERNAL: required public for testing access.
Overrides:
getIdentityMapManager in class oracle.toplink.publicinterface.Session

getParent

public oracle.toplink.threetier.ServerSession getParent()
INTERNAL: Return the parent. This is a server session.

getQuery

public DatabaseQuery getQuery(java.lang.String name)
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return the query from the session pre-defined queries with the given name. This allows for common queries to be pre-defined, reused and executed by name.
Specified by:
getQuery in interface Session
Overrides:
getQuery in class oracle.toplink.publicinterface.Session

getQuery

public DatabaseQuery getQuery(java.lang.String name,
                              java.util.Vector args)
INTERNAL:
Overrides:
getQuery in class oracle.toplink.publicinterface.Session
See Also:
Session.getQuery(String)

initializeSequencing

public void initializeSequencing()
INTERNAL: was ADVANCED: Creates sequencing object for the session. Typically there is no need for the user to call this method - it is called from the constructor.

getSequencing

public oracle.toplink.internal.sequencing.Sequencing getSequencing()
INTERNAL: Return the Sequencing object used by the session.
Overrides:
getSequencing in class oracle.toplink.publicinterface.Session

getWriteConnection

public oracle.toplink.internal.databaseaccess.Accessor getWriteConnection()
INTERNAL: Return the connection to be used for database modification.

hasCacheSynchronizationManager

public boolean hasCacheSynchronizationManager()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return true if a cache synchronisation manager exists.
Specified by:
hasCacheSynchronizationManager in interface Session
Overrides:
hasCacheSynchronizationManager in class oracle.toplink.publicinterface.Session

initializeAllIdentityMaps

public void initializeAllIdentityMaps()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Reset the entire object cache. This method blows away both this session's and its parents caches, including the server cache or any other cache. This throws away any objects that have been read in. Extream caution should be used before doing this because object identity will no longer be maintained for any objects currently read in. This should only be called if the application knows that it no longer has references to object held in the cache.
Specified by:
initializeAllIdentityMaps in interface Session
Overrides:
initializeAllIdentityMaps in class oracle.toplink.publicinterface.Session

initializeIdentityMap

public void initializeIdentityMap(java.lang.Class theClass)
INTERNAL: Was PUBLIC: customer will be redirected to Session. The client session does not have a local indentity map, so this has no effect and should not be used.
Specified by:
initializeIdentityMap in interface Session
Overrides:
initializeIdentityMap in class oracle.toplink.publicinterface.Session

initializeIdentityMaps

public void initializeIdentityMaps()
INTERNAL: Was PUBLIC: customer will be redirected to Session. The client session does not have a local indentity map, so this has no effect and should not be used.
Specified by:
initializeIdentityMaps in interface Session
Overrides:
initializeIdentityMaps in class oracle.toplink.publicinterface.Session

internalExecuteQuery

public java.lang.Object internalExecuteQuery(DatabaseQuery query,
DatabaseRow databaseRow)
                                      throws DatabaseException
INTERNAL: Return the results from exeucting the database query. the arguments should be a database row with raw data values. No modify queries are allowed through a server session.
Overrides:
internalExecuteQuery in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException

isActive

public boolean isActive()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return if the client session is actvie (has not been released).

isClientSession

public boolean isClientSession()
INTERNAL: Return if this session is a client session.
Specified by:
isClientSession in interface Session
Overrides:
isClientSession in class oracle.toplink.publicinterface.Session

isConnected

public boolean isConnected()
INTERNAL: Was PUBLIC: customer will be redirected to Session. Return if this session has been connected to the database.
Specified by:
isConnected in interface Session
Overrides:
isConnected in class oracle.toplink.publicinterface.Session

release

public void release()
             throws DatabaseException
INTERNAL: Was PUBLIC: customer will be redirected to Session. Release the client session. This releases the client session back to it server. Normally this will logout of the client session's connection, and allow the client session to garbage collect.
Specified by:
release in interface Session
Overrides:
release in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException

setWriteConnection

public void setWriteConnection(oracle.toplink.internal.databaseaccess.Accessor writeConnection)
INTERNAL: Set the connection to be used for database modification.

toString

public java.lang.String toString()
INTERNAL: Print the connection status with the session.
Overrides:
toString in class oracle.toplink.publicinterface.Session

getCommandManager

public CommandManager getCommandManager()
INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink cluster
Specified by:
getCommandManager in interface Session
Overrides:
getCommandManager in class oracle.toplink.publicinterface.Session
Returns:
a remote command manager
See Also:
#CommandManager

shouldPropagateChanges

public boolean shouldPropagateChanges()
INTERNAL: Return whether changes should be propagated to TopLink cluster. This is one of the required cache synchronization setting
Overrides:
shouldPropagateChanges in class oracle.toplink.publicinterface.Session
Returns:
True if propagation is set to occur, false if not
See Also:
Session.setCommandManager(CommandManager)

Copyright © 1998, 2004 Oracle Corporation. All Rights Reserved.