Class RemoteSession

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Field Detail

      • sequencing

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

        protected boolean shouldEnableDistributedIndirectionGarbageCollection
    • Constructor Detail

      • 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 Detail

      • 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.
      • 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
      • 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 java.lang.Object getObjectCorrespondingTo​(java.lang.Object serverSideDomainObject,
                                                         java.util.Map objectDescriptors,
                                                         java.util.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 java.lang.Object getObjectsCorrespondingToAll​(java.lang.Object serverSideDomainObjects,
                                                             java.util.Map objectDescriptors,
                                                             java.util.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 java.lang.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
      • 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