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

Problem when using multiple EntityManagerFactories for different datasources in the same route

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.7.3, 3.8.0, 3.9.0
    • 3.7.4, 3.10.0
    • camel-jpa
    • None
    • Unknown

    Description

      When using multiple datasources for jpa in the same route, the EntityManager first created gets reused for the second jpa call, but this is the wrong EntityManager (for datasource 1 instead of datasource 2).

      This re-use is found in the JpaHelper class where the EntityManager is stored as property on the Exchange.

      The outcome of this PR will still result in re-use of the Entitymanager but storing the EntityManager in a map with the hashCode of the EntityManagerFactory as a key.

      Attachments

        Issue Links

          Activity

            People

              acosentino Andrea Cosentino
              TCke83 Tom Cassimon
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: