Class MockConnectionProvider

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.sql.Connection acquire()
      Acquire a connection from the connection lifecycle handler.
      void release​(java.sql.Connection connection)
      Release a connection to the connection lifecycle handler.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • acquire

        public final java.sql.Connection acquire()
        Description copied from interface: ConnectionProvider
        Acquire a connection from the connection lifecycle handler.

        This method is called by jOOQ exactly once per execution lifecycle, i.e. per ExecuteContext. Implementations may freely chose, whether subsequent calls to this method:

        • return the same connection instance
        • return the same connection instance for the same thread
        • return the same connection instance for the same transaction (e.g. a javax.transaction.UserTransaction)
        • return a fresh connection instance every time

        jOOQ will guarantee that every acquired connection is released through ConnectionProvider.release(Connection) exactly once.

        Specified by:
        acquire in interface ConnectionProvider
        Returns:
        A connection for the current ExecuteContext.
      • release

        public final void release​(java.sql.Connection connection)
        Description copied from interface: ConnectionProvider
        Release a connection to the connection lifecycle handler.

        jOOQ will guarantee that every acquired connection is released exactly once.

        Specified by:
        release in interface ConnectionProvider
        Parameters:
        connection - A connection that was previously obtained from ConnectionProvider.acquire(). This is never null.