You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/08 13:01:40 UTC

[GitHub] [camel] vgaur commented on a change in pull request #5314: CAMEL-16470 - fix for reuse EntityManager

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:
users@infra.apache.org