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

camel-sql, use primary spring data source by default

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.18.8
    • 4.2.0
    • camel-sql
    • None
    • Unknown

    Description

      Improvement suggestion: If there are more than one datasource available, the method shall return the primary datasource, or none if there is no primary datasource.

      DefaultAutowiredLifecycleStrategy#autwire() does not return any datasource from the spring context if there are more than one datasource in the spring context.

      This improvement will mitigate the following inconvenience: When adding a second datasource, e.g. by external XML spring bean configuration, the existing SQL endpoints not having a datasource parameter stopped using the default spring datasource and failed at runtime.
      This problem was very hard to come by, as there is no obvious reason or message, why the former datasource still present in the context is no longer used. Defining the main spring.datasource as @Primary did not resolve the problem.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              lbreuss Leo Breuss
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: