Package oracle.ucp

Interface ConnectionAffinityCallback


  • public interface ConnectionAffinityCallback
    The callback interface for the Oracle RAC affinity features. Oracle RAC affinity features allow related connection requests to be directed to the same Oracle RAC instance within a certain period of time, in order to achieve better overall performance. UCP supports two Oracle RAC affinity policies: transaction-based affinity and web-session-based affinity.

    Transaction-based affinity allows applications to group connection requests to the same Oracle RAC instance based on their semantical correlation. Connection requests within the same distributed transaction are directed to the same Oracle RAC instance when possible.

    Web-session affinity directs connection requests originated by the same Web-session to the same Oracle RAC instance when possible.

    This interface allows the Universal Connection Pool to establish and retrieve connection affinity context inside its application in order to return appropriate connections that satisfy Oracle RAC affinity requirements. The interface also allows applications to inform the pool of their choice of the connection affinity policy.

    • Method Detail

      • setConnectionAffinityContext

        boolean setConnectionAffinityContext​(java.lang.Object affinityContext)
        Sets the connection affinity context object inside UCP application.
        Parameters:
        affinityContext - Connection Affinity Context object.
        Returns:
        true if Affinity Context is successfully set; false otherwise.
      • getConnectionAffinityContext

        java.lang.Object getConnectionAffinityContext()
        Obtains the connection affinity context object from UCP application.
        Returns:
        Connection Affinity Context object.