[
https://issues.apache.org/jira/browse/CAMEL-13529?focusedWorklogId=246810&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-246810
]
ASF GitHub Bot logged work on CAMEL-13529:
------------------------------------------
Author: ASF GitHub Bot
Created on: 22/May/19 15:41
Start Date: 22/May/19 15:41
Worklog Time Spent: 10m
Work Description: oscerd commented on pull request #2937: [CAMEL-13529]
Update to make sure the camel-jdbc work with the spring tx manager
URL: https://github.com/apache/camel/pull/2937
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 246810)
Time Spent: 20m (was: 10m)
> camel-jdbc - Improve to work with the spring Tx Manager
> -------------------------------------------------------
>
> Key: CAMEL-13529
> URL: https://issues.apache.org/jira/browse/CAMEL-13529
> Project: Camel
> Issue Type: Improvement
> Components: camel-jdbc
> Reporter: Zheng Feng
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 3.0.0, 3.0.0-M3, 2.25.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> currently the camel-jdbc does not work correctly with the spring
> [DataSourceTransactionManager|https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/datasource/DataSourceTransactionManager.html]
> {noformat}
> 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.
> {noformat}
> 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]
> {noformat}
> 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.
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)