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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.3, 3.8.0, 3.9.0
    • Fix Version/s: 3.7.4, 3.10.0
    • Component/s: camel-jpa
    • Labels:
      None
    • Estimated Complexity:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: