Class RemoteUnitOfWork

    • Field Detail

      • newObjectsCache

        protected List newObjectsCache
      • unregisteredNewObjectsCache

        protected List unregisteredNewObjectsCache
      • isOnClient

        protected boolean isOnClient
      • isFlush

        protected boolean isFlush
    • Method Detail

      • isFlush

        public boolean isFlush()
      • setIsFlush

        public void setIsFlush​(boolean isFlush)
      • acquireUnitOfWork

        public UnitOfWorkImpl acquireUnitOfWork​(ReferenceMode referenceMode)
        The nested unit of work must also be remote.
        Specified by:
        acquireUnitOfWork in interface Session
        Overrides:
        acquireUnitOfWork in class 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 that support active object change tracking and hard references for deferred change tracked objects. Setting to FORCE_WEAK means that all objects will be referenced by weak references 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
      • collectNewObjects

        protected List collectNewObjects()
        This is done to maintain correspondence between local new objects and returned new objects from serialization. Object correspondence is maintained by comparing primary keys but for new objects it is possible that primary key value is null as it is still not inserted. The returned new objects from serialization will have primary key value which will be inserted into corresponding local new objects.
      • collectUnregisteredNewObjects

        protected List collectUnregisteredNewObjects()
        This is done to maintain correspondence between local unregistered new objects and returned unregistered new objects from serialization. Object correspondence is maintained by comparing primary keys but for unregistered new objects it is possible that primary key value is null as it is still not inserted. The returned unregistered new objects from serialization will have primary key value which will be inserted into corresponding local new objects.
      • commitIntoRemoteUnitOfWork

        protected void commitIntoRemoteUnitOfWork()
        The remote unit of work returned after its commit on the server is merged with remote unit of work on the remote side.
      • commitRootUnitOfWork

        public void commitRootUnitOfWork()
        Starts committing the remote unit of work. This must serialize the unit of work across to the server, commit the unit of work on the server, serialize it back and merge any server-side changes (such as sequence numbers) it into itself, then merge into the parent remote session.
        Overrides:
        commitRootUnitOfWork in class RepeatableWriteUnitOfWork
      • resumeUnitOfWork

        public void resumeUnitOfWork()
        INTERNAL: Resume is not required on the server.
        Overrides:
        resumeUnitOfWork in class UnitOfWorkImpl
      • commitRootUnitOfWorkOnClient

        protected void commitRootUnitOfWorkOnClient()
        Merges remote unit of work to parent remote session.
      • getNewObjectsCache

        public List getNewObjectsCache()
        Returns a new object cache
      • getParentSessionController

        public RemoteSessionController getParentSessionController()
        INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client
      • getUnregisteredNewObjectsCache

        public List getUnregisteredNewObjectsCache()
        Returns an unregistered new object cache
      • isOnClient

        protected boolean isOnClient()
      • prepareForMergeIntoRemoteUnitOfWork

        protected void prepareForMergeIntoRemoteUnitOfWork()
        The returned remote unit of work from the server is prepared to merge with local remote unit of work.
      • reinitializeForSession

        public void reinitializeForSession​(AbstractSession session,
                                           RemoteSessionController parentSessionController)
        INTERNAL: Re-initialize for the server-side session. This is done when the uow is passed back to the server for committing.
      • fixRemoteChangeSet

        protected void fixRemoteChangeSet​(UnitOfWorkChangeSet uowChangeSet,
                                          Map cloneMap,
                                          AbstractSession session)
        INTERNAL: Fix the transient fields in the serialized change set.
      • setIsOnClient

        protected void setIsOnClient​(boolean isOnClient)
      • setNewObjectsCache

        protected void setNewObjectsCache​(List newObjectsCache)
        Set a new object cache
      • setParentSessionController

        public void setParentSessionController​(RemoteSessionController parentSessionController)
        INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client
      • setUnregisteredNewObjectsCache

        protected void setUnregisteredNewObjectsCache​(List unregisteredNewObjectsCache)
        Set unregistered new object cache
      • verifyDelete

        public boolean verifyDelete​(Object domainObject)
        TESTING: This is used by testing code to ensure that a deletion was successful.
        Overrides:
        verifyDelete in class AbstractSession