public class MockConnectionProvider extends Object implements ConnectionProvider
This ConnectionProvider
wraps a delegate
ConnectionProvider
and wraps all acquired Connection
references in MockConnection
.
Constructor and Description |
---|
MockConnectionProvider(ConnectionProvider delegate,
MockDataProvider provider) |
Modifier and Type | Method and Description |
---|---|
Connection |
acquire()
Acquire a connection from the connection lifecycle handler.
|
void |
release(Connection connection)
Release a connection to the connection lifecycle handler.
|
public MockConnectionProvider(ConnectionProvider delegate, MockDataProvider provider)
public final Connection acquire()
ConnectionProvider
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:
javax.transaction.UserTransaction
)
jOOQ will guarantee that every acquired connection is released through
ConnectionProvider.release(Connection)
exactly once.
acquire
in interface ConnectionProvider
ExecuteContext
.public final void release(Connection connection)
ConnectionProvider
jOOQ will guarantee that every acquired connection is released exactly once.
release
in interface ConnectionProvider
connection
- A connection that was previously obtained from
ConnectionProvider.acquire()
. This is never null
.Copyright © 2016. All Rights Reserved.