closing entity manager

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/18f7de62
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/18f7de62
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/18f7de62

Branch: refs/heads/camel-2.19.x
Commit: 18f7de6275af06d359e199834616adb91e3d0444
Parents: 60a6bf9
Author: mkcochran <mcoch...@redhat.com>
Authored: Thu Aug 10 15:54:38 2017 -0400
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Aug 13 01:54:32 2017 +0200

----------------------------------------------------------------------
 .../camel/processor/idempotent/jpa/JpaMessageIdRepository.java    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/18f7de62/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
 
b/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
index f992715..1d9b717 100644
--- 
a/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
+++ 
b/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
@@ -104,6 +104,7 @@ public class JpaMessageIdRepository extends ServiceSupport 
implements ExchangeId
                     processed.setCreatedAt(new Date());
                     entityManager.persist(processed);
                     entityManager.flush();
+                    entityManager.close();
                     return Boolean.TRUE;
                 } else {
                     return Boolean.FALSE;
@@ -166,6 +167,7 @@ public class JpaMessageIdRepository extends ServiceSupport 
implements ExchangeId
                     MessageProcessed processed = (MessageProcessed) 
list.get(0);
                     entityManager.remove(processed);
                     entityManager.flush();
+                    entityManager.close();
                     return Boolean.TRUE;
                 }
             }
@@ -204,6 +206,7 @@ public class JpaMessageIdRepository extends ServiceSupport 
implements ExchangeId
                         entityManager.remove(item);
                     }
                     entityManager.flush();
+                    entityManager.close();
                 }
                 return Boolean.TRUE;
             }

Reply via email to