Class RemoteSession

java.lang.Object
org.eclipse.persistence.internal.core.sessions.CoreAbstractSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>
org.eclipse.persistence.internal.sessions.AbstractSession
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl
org.eclipse.persistence.sessions.remote.DistributedSession
org.eclipse.persistence.sessions.remote.RemoteSession
All Implemented Interfaces:
Serializable, Cloneable, CoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>, CommandProcessor, DatabaseSession, Session

public class RemoteSession extends DistributedSession
Purpose: Provide transparent remote three-tiered replacation support. The remote session allows for complex three-tiered applications to be easily built. It gives the remote client the fully functionality of the TopLink api including,
  • Client side caching and object-identity maintainence.
  • Complex query support
  • Unit of work support
  • Indirection support through remote value holders.
This session is a primary interface which resides on the client side. Users would interact with session just the same way as if it was a normal session.
See Also:
  • Field Details

    • sequencing

      protected org.eclipse.persistence.internal.sequencing.Sequencing sequencing
    • shouldEnableDistributedIndirectionGarbageCollection

      protected boolean shouldEnableDistributedIndirectionGarbageCollection
  • Constructor Details

    • RemoteSession

      public RemoteSession()
    • RemoteSession

      public RemoteSession(org.eclipse.persistence.internal.sessions.remote.RemoteConnection remoteConnection)
      PUBLIC: Creates a RemoteSession.
      Parameters:
      remoteConnection - remote session requires a remote connection. This must be accessed remotely from the client through RMI or CORBA.
  • Method Details

    • setShouldEnableDistributedIndirectionGarbageCollection

      public void setShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)
      ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
    • shouldEnableDistributedIndirectionGarbageCollection

      public boolean shouldEnableDistributedIndirectionGarbageCollection()
      ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
    • acquireHistoricalSession

      public Session acquireHistoricalSession(AsOfClause clause) throws ValidationException
      INTERNAL: Acquires a special historical session for reading objects as of a past time.
      Specified by:
      acquireHistoricalSession in interface Session
      Overrides:
      acquireHistoricalSession in class org.eclipse.persistence.internal.sessions.AbstractSession
      Parameters:
      clause - Represents a valid snap shot time.
      Throws:
      ValidationException - if this not a ClientSession, plain Session, or SessionBroker.
      See Also:
    • acquireUnitOfWork

      public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl 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
      Specified by:
      acquireUnitOfWork in class DistributedSession
      See Also:
      • UnitOfWorkImpl
    • acquireUnitOfWork

      public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
      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 org.eclipse.persistence.internal.sessions.AbstractSession
      Parameters:
      referenceMode - The reference type the UOW should use internally when referencing Working clones. Setting this to WEAK means the UOW will use weak references to reference clones and if the application no longer references the clone the clone may be garbage collected. If the clone has uncommitted changes then those changes will be lost.
      See Also:
      • UnitOfWorkImpl
    • acquireRepeatableWriteUnitOfWork

      public org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork acquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)
      PUBLIC: Return a repeatable write unit of work for this session. A repeatable write unit of work allows multiple writeChanges (flushes).
      Overrides:
      acquireRepeatableWriteUnitOfWork in class org.eclipse.persistence.internal.sessions.AbstractSession
      See Also:
      • RepeatableWriteUnitOfWork
    • executeQuery

      public Object executeQuery(DatabaseQuery query)
      PUBLIC: Execute the database query.
      Specified by:
      executeQuery in interface Session
      Specified by:
      executeQuery in class DistributedSession
      See Also:
    • getDatasourceLogin

      public Login getDatasourceLogin()
      PUBLIC: Return the login. This must retrieve the login information from the server this first time called. This is useful to be able to do things differently depending on the database platform.
      Specified by:
      getDatasourceLogin in interface CoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>
      Specified by:
      getDatasourceLogin in interface Session
      Overrides:
      getDatasourceLogin in class org.eclipse.persistence.internal.sessions.AbstractSession
    • getObjectCorrespondingTo

      public Object getObjectCorrespondingTo(Object serverSideDomainObject, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query)
      INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
      Specified by:
      getObjectCorrespondingTo in class DistributedSession
    • getObjectsCorrespondingToAll

      public Object getObjectsCorrespondingToAll(Object serverSideDomainObjects, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
      INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
      Specified by:
      getObjectsCorrespondingToAll in class DistributedSession
    • instantiateRemoteValueHolderOnServer

      public Object instantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
      INTERNAL: This will instantiate value holder on the server.
      Specified by:
      instantiateRemoteValueHolderOnServer in class DistributedSession
    • isRemoteSession

      public boolean isRemoteSession()
      INTERNAL: Return if this session is remote.
      Specified by:
      isRemoteSession in interface Session
      Overrides:
      isRemoteSession in class DistributedSession
    • getSequencing

      public org.eclipse.persistence.internal.sequencing.Sequencing getSequencing()
      INTERNAL: Return the Sequencing object used by the session. Sequences may be provided locally, or remotely.
      Overrides:
      getSequencing in class org.eclipse.persistence.internal.sessions.DatabaseSessionImpl
    • initializeSequencing

      public void initializeSequencing()
      ADVANCED: Creates sequencing object for the session. Sequences may be provided locally, or remotely.
      Overrides:
      initializeSequencing in class org.eclipse.persistence.internal.sessions.DatabaseSessionImpl