Package org.axonframework.common.jdbc
Class UnitOfWorkAwareConnectionProviderWrapper
java.lang.Object
org.axonframework.common.jdbc.UnitOfWorkAwareConnectionProviderWrapper
- All Implemented Interfaces:
ConnectionProvider
Wrapper for a ConnectionProvider that checks if a connection is already attached to the Unit of Work, favoring that
connection over creating a new one.
- Since:
- 2.2
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a ConnectionProvider, using givendelegateto create a new instance, when on is not already attached to the Unit of Work. -
Method Summary
Modifier and TypeMethodDescriptionReturns a connection, ready for use.
-
Constructor Details
-
UnitOfWorkAwareConnectionProviderWrapper
Initializes a ConnectionProvider, using givendelegateto create a new instance, when on is not already attached to the Unit of Work.- Parameters:
delegate- The connection provider creating connections, when required
-
-
Method Details
-
getConnection
Description copied from interface:ConnectionProviderReturns a connection, ready for use.- Specified by:
getConnectionin interfaceConnectionProvider- Returns:
- a new connection to use
- Throws:
SQLException- when an error occurs obtaining the connection
-