vgaur commented on a change in pull request #5314:
URL: https://github.com/apache/camel/pull/5314#discussion_r609673681



##########
File path: 
components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaHelper.java
##########
@@ -54,34 +57,47 @@ public static EntityManager getTargetEntityManager(
 
         // then try reuse any entity manager which has been previously created 
and stored on the exchange
         if (em == null && exchange != null) {
-            em = exchange.getProperty(JpaConstants.ENTITY_MANAGER, 
EntityManager.class);
+            em = 
getEntityManagerMap(exchange).get(getKey(entityManagerFactory));
         }
 
         if (em == null && useSharedEntityManager) {

Review comment:
       since getEntityManagerMap() will now return empty map, should we add a 
condition for empty check as well ? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to