Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
currently the camel-jdbc does not work correctly with the spring DataSourceTransactionManager
Application code is required to retrieve the JDBC Connection via DataSourceUtils.getConnection(DataSource) instead of a standard Java EE-style DataSource.getConnection() call. Spring classes such as JdbcTemplate use this strategy implicitly. If not used in combination with this transaction manager, the DataSourceUtils lookup strategy behaves exactly like the native DataSource lookup; it can thus be used in a portable fashion.
So we have to add the extra dependency on the spring-jdbc to support to work with the spring Tx Manager by replacing to use DataSourceUtils.getConnection(DataSource).
Quote from davsclaus
Well in light of that using transactions with spring TX managers and JDBC seems to not work together, then its limited. So yeah I think its an okay trade-off to have that extra set of dependencies to make it work well with both Spring and I assume also plain JEE. If not we can add an option to use either the spring datasource lookup or the current approach. However I would be puzzled if that spring-jdbc didn't work OOTB with JEE API too.
Attachments
Issue Links
- relates to
-
CAMEL-16572 camel-spring-jdbc - Make camel-jdbc springless again
- Resolved
- links to