Acquire a connection from the connection lifecycle handler.
This method is called by jOOQ exactly once per execution lifecycle, i.e. per {@link 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 {@link #release(Connection)} exactly once.
@return A connection for the current ExecuteContext
.
@throws DataAccessException If anything went wrong while acquiring aconnection