Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
2.14.1
-
None
-
None
-
Unknown
Description
JdbcProducer gets java.sql.Connection by direct call to javax.sql.DataSource#getConnection(). But depending on dataSource used, the acquired connection may not be the correct JDBC connection (and XAResource in case of XA transactions) which is currently associated with org.springframework.transaction.PlatformTransactionManager used by org.springframework.transaction.support.TransactionTemplate which is used by Camel's <transacted> (org.apache.camel.spring.spi.TransactionErrorHandler).
JdbcProducer might use:
- org.springframework.jdbc.datasource.DataSourceUtils#getConnection()
- org.springframework.jdbc.datasource.DataSourceUtils#releaseConnection()
just like Spring's JdbcTemplate does it (and camel-sql component uses).