Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13529

camel-jdbc - Improve to work with the spring Tx Manager

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-M3, 3.0.0, 2.25.0
    • camel-jdbc
    • 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

          Activity

            People

              acosentino Andrea Cosentino
              zhfeng Zheng Feng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m