public class MockConnectionProvider extends java.lang.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 |
---|---|
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.
|
public MockConnectionProvider(ConnectionProvider delegate, MockDataProvider provider)
public final java.sql.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(java.sql.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 © 2018. All Rights Reserved.