Oracle Application Server TopLink API Reference
10g (9.0.4.3)

B10491-02

oracle.toplink.remote
Class DistributedSession

java.lang.Object
  extended byoracle.toplink.publicinterface.Session
      extended byoracle.toplink.remote.DistributedSession

All Implemented Interfaces:
java.lang.Cloneable, CommandProcessor, java.io.Serializable, Session
Direct Known Subclasses:
ProxySession, RemoteSession

public abstract class DistributedSession
extends oracle.toplink.publicinterface.Session

Purpose: Super class to all remote client session's.

See Also:
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
DistributedSession(oracle.toplink.internal.remote.RemoteConnection remoteConnection)
          PUBLIC: Creates a DistributedSession.

 

Method Summary
abstract  oracle.toplink.publicinterface.UnitOfWork acquireUnitOfWork()
          PUBLIC: Return a unit of work for this session.
 void beginTransaction()
          PUBLIC: Start a transaction on the server.
 void commitTransaction()
          PUBLIC: Commit a transaction on the server.
 oracle.toplink.internal.remote.RemoteCursoredStream cursorSelectObjects(CursoredStreamPolicy policy)
          INTERNAL: Return remote cursor stream.
 oracle.toplink.internal.remote.RemoteScrollableCursor cursorSelectObjects(ScrollableCursorPolicy policy)
          INTERNAL: Return remote scrollable cursor
abstract  java.lang.Object executeQuery(DatabaseQuery query)
          Execute the database query.
 java.lang.Object executeQuery(DatabaseQuery query, DatabaseRow row)
          INTERNAL: Execute the database query.
 java.lang.Object executeQuery(java.lang.String queryName)
          PUBLIC: Execute the pre-defined query by name and return the result.
 java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass)
          PUBLIC: Execute the pre-defined query by name and return the result.
 java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.Vector argumentValues)
          PUBLIC: Execute the pre-defined query by name and return the result.
 java.lang.Object executeQuery(java.lang.String queryName, java.util.Vector argumentValues)
          PUBLIC: Execute the pre-defined query by name and return the result.
 java.util.Vector getDefaultReadOnlyClasses()
          INTERNAL: CR#2751 Returns the set of read-only classes for the receiver.
 Descriptor getDescriptor(java.lang.Class domainClass)
          INTERNAL: Return the table descriptor specified for the class.
 Descriptor getDescriptorCorrespondingTo(Descriptor descriptor)
          INTERNAL: Return the descriptor.
abstract  java.lang.Object getObjectCorrespondingTo(java.lang.Object serverSideDomainObject, oracle.toplink.internal.helper.IdentityHashtable objectDescriptors, oracle.toplink.internal.helper.IdentityHashtable processedObjects, ObjectLevelReadQuery query)
          INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
abstract  java.lang.Object getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects, oracle.toplink.internal.helper.IdentityHashtable objectDescriptors, oracle.toplink.internal.helper.IdentityHashtable processedObjects, ObjectLevelReadQuery query, oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
          INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
 oracle.toplink.internal.remote.RemoteConnection getRemoteConnection()
          INTERNAL: Return the remote connection.
 boolean hasCorrespondingDescriptor(Descriptor descriptor)
          INTERNAL: Checks if the descriptor exists or not.
 void initializeAllIdentityMaps()
          Reset the entire object cache.
abstract  java.lang.Object instantiateRemoteValueHolderOnServer(oracle.toplink.internal.remote.RemoteValueHolder remoteValueHolder)
          INTERNAL: This will instantiate value holder on the server.
 boolean isConnected()
          PUBLIC: Return if this session is connected.
 boolean isDistributedSession()
          INTERNAL: Return if this session is a distributed session.
 boolean isProxySession()
          INTERNAL: Return if this session is a proxy session.
 boolean isRemoteSession()
          INTERNAL: Return if this session is a remote session.
 void privilegedAddDescriptor(Descriptor descriptor)
          INTERNAL: You cannot add descriptors to a remote session.
 void release()
          PUBLIC: Logout the session, close the remote connection and release the hold resources
 void rollbackTransaction()
          PUBLIC: Rollback a transaction on the server.
 java.lang.String toString()
          PUBLIC: Avoid printing the accessor and platform.
 boolean verifyDelete(java.lang.Object domainObject)
          INTERNAL: TESTING: This is used by testing code to ensure that a deletion was successful.

 

Methods inherited from class oracle.toplink.publicinterface.Session
acquireIdentityMapDeferredLock, acquireIdentityMapLock, acquireNonSynchronizedUnitOfWork, addAlias, addAliasesFromProject, addQuery, afterTransaction, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, compareObjects, compareObjectsDontMatch, containsObjectInIdentityMap, containsObjectInIdentityMap, containsQuery, copyObject, copyObject, copyReadOnlyClasses, decrementMergesPending, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, dontLogSQL, endOperationProfile, executeCall, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getAccessor, getAccessor, getAccessor, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllFromIdentityMap, getAllFromIdentityMap, getAllQueries, getBroker, getCacheSynchronizationManager, getCommandManager, getCommitManager, getDescriptor, getDescriptorForAlias, getDescriptors, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExternalTransactionController, getExternalTransactionControllerClass, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMapWithDeferredLock, getIdentityMapManager, getIntegrityChecker, getLog, getLoggingStream, getLogin, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getPlatform, getPlatform, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getSequencing, getSessionForClass, getSessionLog, getTransactionMutex, getWrapper, getWriteLockValue, getWriteLockValue, handleException, hasBroker, hasCacheSynchronizationManager, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, incrementMergesPending, initializeIdentityMap, initializeIdentityMaps, insertObject, internalExecuteQuery, isBroker, isClassReadOnly, isClientSession, isDatabaseSession, isInBroker, isInProfile, isInTransaction, 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, 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, shouldPropagateChanges, startOperationProfile, unwrapObject, updatedCacheKeyInIdentityMap, updateObject, updateWriteLockValue, updateWriteLockValue, usesExternalTransactionController, usesOldCommit, validateCache, wasJTSTransactionInternallyStarted, wrapObject, writeObject

 

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

 

Constructor Detail

DistributedSession

public DistributedSession(oracle.toplink.internal.remote.RemoteConnection remoteConnection)
PUBLIC: Creates a DistributedSession.
Parameters:
remoteConnection - remote session requires a remote connection. This must be accessed remotely from the client through RMI or CORBA.
Method Detail

acquireUnitOfWork

public abstract oracle.toplink.publicinterface.UnitOfWork acquireUnitOfWork()
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.
Specified by:
acquireUnitOfWork in interface Session
Overrides:
acquireUnitOfWork in class oracle.toplink.publicinterface.Session
See Also:
UnitOfWork

beginTransaction

public void beginTransaction()
PUBLIC: Start a transaction on the server. A unit of work should normally be used instead of transactions for the remote session.
Overrides:
beginTransaction in class oracle.toplink.publicinterface.Session
See Also:
Session.isInTransaction()

commitTransaction

public void commitTransaction()
PUBLIC: Commit a transaction on the server. A unit of work should normally be used instead of transactions for the remote session.
Overrides:
commitTransaction in class oracle.toplink.publicinterface.Session

cursorSelectObjects

public oracle.toplink.internal.remote.RemoteCursoredStream cursorSelectObjects(CursoredStreamPolicy policy)
INTERNAL: Return remote cursor stream.

cursorSelectObjects

public oracle.toplink.internal.remote.RemoteScrollableCursor cursorSelectObjects(ScrollableCursorPolicy policy)
INTERNAL: Return remote scrollable cursor

executeQuery

public java.lang.Object executeQuery(java.lang.String queryName)
                              throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The named query can be defined on the remote session or the server-side session.
Specified by:
executeQuery in interface Session
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException
See Also:
Session.addQuery(String, DatabaseQuery)

executeQuery

public java.lang.Object executeQuery(java.lang.String queryName,
                                     java.lang.Class domainClass)
                              throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined. The query is executed on the server-side session.
Specified by:
executeQuery in interface Session
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException
See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)

executeQuery

public java.lang.Object executeQuery(java.lang.String queryName,
                                     java.lang.Class domainClass,
                                     java.util.Vector argumentValues)
                              throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.
Specified by:
executeQuery in interface Session
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException
See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)

executeQuery

public java.lang.Object executeQuery(java.lang.String queryName,
                                     java.util.Vector argumentValues)
                              throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.
Specified by:
executeQuery in interface Session
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session
Throws:
DatabaseException
See Also:
Session.addQuery(String, DatabaseQuery)

executeQuery

public abstract java.lang.Object executeQuery(DatabaseQuery query)
Execute the database query.
Specified by:
executeQuery in interface Session
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session
See Also:
DatabaseQuery

executeQuery

public java.lang.Object executeQuery(DatabaseQuery query,
DatabaseRow row)
INTERNAL: Execute the database query.
Overrides:
executeQuery in class oracle.toplink.publicinterface.Session

getDefaultReadOnlyClasses

public java.util.Vector getDefaultReadOnlyClasses()
INTERNAL: CR#2751 Returns the set of read-only classes for the receiver. These class come from the Remote connection
Overrides:
getDefaultReadOnlyClasses in class oracle.toplink.publicinterface.Session
Returns:
A Vector containing the Java Classes that are currently read-only.
See Also:
#setDefaultReadOnlyClasses()

getDescriptor

public Descriptor getDescriptor(java.lang.Class domainClass)
INTERNAL: Return the table descriptor specified for the class.
Specified by:
getDescriptor in interface Session
Overrides:
getDescriptor in class oracle.toplink.publicinterface.Session

getDescriptorCorrespondingTo

public Descriptor getDescriptorCorrespondingTo(Descriptor descriptor)
INTERNAL: Return the descriptor.

getObjectCorrespondingTo

public abstract java.lang.Object getObjectCorrespondingTo(java.lang.Object serverSideDomainObject,
                                                          oracle.toplink.internal.helper.IdentityHashtable objectDescriptors,
                                                          oracle.toplink.internal.helper.IdentityHashtable processedObjects,
ObjectLevelReadQuery query)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.

getObjectsCorrespondingToAll

public abstract java.lang.Object getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects,
                                                              oracle.toplink.internal.helper.IdentityHashtable objectDescriptors,
                                                              oracle.toplink.internal.helper.IdentityHashtable processedObjects,
ObjectLevelReadQuery query,
                                                              oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.

getRemoteConnection

public oracle.toplink.internal.remote.RemoteConnection getRemoteConnection()
INTERNAL: Return the remote connection.

hasCorrespondingDescriptor

public boolean hasCorrespondingDescriptor(Descriptor descriptor)
INTERNAL: Checks if the descriptor exists or not.

initializeAllIdentityMaps

public void initializeAllIdentityMaps()
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

instantiateRemoteValueHolderOnServer

public abstract java.lang.Object instantiateRemoteValueHolderOnServer(oracle.toplink.internal.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: This will instantiate value holder on the server.

isConnected

public boolean isConnected()
PUBLIC: Return if this session is connected.
Specified by:
isConnected in interface Session
Overrides:
isConnected in class oracle.toplink.publicinterface.Session

isDistributedSession

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

isProxySession

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

isRemoteSession

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

privilegedAddDescriptor

public void privilegedAddDescriptor(Descriptor descriptor)
INTERNAL: You cannot add descriptors to a remote session. This is a internal method used by TopLink

rollbackTransaction

public void rollbackTransaction()
PUBLIC: Rollback a transaction on the server. A unit of work should normally be used instead of transactions for the remote session.
Overrides:
rollbackTransaction in class oracle.toplink.publicinterface.Session

toString

public java.lang.String toString()
PUBLIC: Avoid printing the accessor and platform.
Overrides:
toString in class oracle.toplink.publicinterface.Session

verifyDelete

public boolean verifyDelete(java.lang.Object domainObject)
INTERNAL: TESTING: This is used by testing code to ensure that a deletion was successful.
Overrides:
verifyDelete in class oracle.toplink.publicinterface.Session

release

public void release()
PUBLIC: Logout the session, close the remote connection and release the hold resources
Specified by:
release in interface Session
Overrides:
release in class oracle.toplink.publicinterface.Session

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