Enum ConnectionStrategy

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALWAYS_NEW
      Always create the connection before the request and close it when it is complete.
      OPEN_ON_REQUEST
      Connections are created before request or borrowed from a session-local pool.
      SESSION_POOLS
      Connections are created in a shared pool.
      SHARED_POOL
      Connections are created in a pool and then borrowed by the session.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ConnectionStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ConnectionStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SHARED_POOL

        public static final ConnectionStrategy SHARED_POOL
        Connections are created in a pool and then borrowed by the session. When the request is complete the connection is returned to the shared pool.
      • SESSION_POOLS

        public static final ConnectionStrategy SESSION_POOLS
        Connections are created in a shared pool. When the request is completed it is not returned to the shared pool but to a session-local pool. Subsequent requests by this session first try to acquire the connection from this local pool. When the session completes all connections from the session-local pool are returned to the shared pool.
      • OPEN_ON_REQUEST

        public static final ConnectionStrategy OPEN_ON_REQUEST
        Connections are created before request or borrowed from a session-local pool. When the request is completed the connection is returned to this pool. When the session completes all connections from the session-local pool are closed.
      • ALWAYS_NEW

        public static final ConnectionStrategy ALWAYS_NEW
        Always create the connection before the request and close it when it is complete. No pooling of connections.
    • Method Detail

      • values

        public static ConnectionStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ConnectionStrategy c : ConnectionStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ConnectionStrategy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null