Class SpringDataSourceConnectionProvider
java.lang.Object
org.axonframework.extension.spring.jdbc.SpringDataSourceConnectionProvider
- All Implemented Interfaces:
ConnectionProvider
ConnectionProvider implementation that is aware of Transaction Managers and provides the connection attached to an
active transaction manager, instead of asking a Data Source directly.
- Since:
- 2.2
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionSpringDataSourceConnectionProvider(DataSource dataSource) Initialize the connection provider, using givendataSourceto obtain a connection, when required. -
Method Summary
Modifier and TypeMethodDescriptionReturns a connection, ready for use.
-
Constructor Details
-
SpringDataSourceConnectionProvider
Initialize the connection provider, using givendataSourceto obtain a connection, when required.- Parameters:
dataSource- The data source to obtain connections from, when required
-
-
Method Details
-
getConnection
Description copied from interface:ConnectionProviderReturns a connection, ready for use.The caller must never commit, roll back, or close the returned connection directly; its lifecycle is managed externally by whatever this provider obtained it from.
- Specified by:
getConnectionin interfaceConnectionProvider- Returns:
- a connection to use, never
null - Throws:
SQLException- when an error occurs obtaining the connection
-