Class IsolatedClientSession

    • Method Detail

      • initializeIdentityMapAccessor

        public void initializeIdentityMapAccessor()
        INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality.
        Overrides:
        initializeIdentityMapAccessor in class ClientSession
      • shouldExecuteLocally

        protected boolean shouldExecuteLocally​(DatabaseQuery query)
        INTERNAL: Helper method to calculate whether to execute this query locally or send it to the server session.
      • isIsolatedQuery

        protected boolean isIsolatedQuery​(DatabaseQuery query)
        INTERNAL: Answers if this query is an isolated query and must be executed locally.
      • getParentIdentityMapSession

        public AbstractSession getParentIdentityMapSession​(ClassDescriptor descriptor,
                                                           boolean canReturnSelf,
                                                           boolean terminalOnly)
        INTERNAL: Returns the appropriate IdentityMap session for this descriptor. Sessions can be chained and each session can have its own Cache/IdentityMap. Entities can be stored at different levels based on Cache Isolation. This method will return the correct Session for a particular Entity class based on the Isolation Level and the attributes provided.

        Overrides:
        getParentIdentityMapSession in class ClientSession
        Parameters:
        canReturnSelf - true when method calls itself. If the path starting at this is acceptable. Sometimes true if want to move to the first valid session, i.e. executing on ClientSession when really should be on ServerSession.
        terminalOnly - return the last session in the chain where the Enitity is stored.
        Returns:
        Session with the required IdentityMap
      • getExecutionSession

        public AbstractSession getExecutionSession​(DatabaseQuery query)
        INTERNAL: Gets the session which this query will be executed on. Generally will be called immediately before the call is translated, which is immediately before session.executeCall.

        Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.

        Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.

        Overrides:
        getExecutionSession in class ClientSession
        Parameters:
        query - may store session name or reference class for brokers case
        Returns:
        a session with a live accessor
      • isIsolatedClientSession

        public boolean isIsolatedClientSession()
        PUBLIC: Return if this session is an isolated client session.
        Overrides:
        isIsolatedClientSession in class AbstractSession
      • isProtectedSession

        public boolean isProtectedSession()
        PUBLIC: Returns true if Protected Entities should be built within this session
        Overrides:
        isProtectedSession in class AbstractSession