Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


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 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.
abstract java.lang.Object executeQuery(DatabaseQuery query)
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.
void initializeAllIdentityMaps()
Reset the entire object cache.
boolean isConnected()
PUBLIC: Return if this session is connected.
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.

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

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

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

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

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

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, 2005 Oracle Corporation. All Rights Reserved.