camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] git commit: CAMEL-7598: JPA consumer should clear entity manager after flush to avoid any jpa provider to keep previous polled entities in any kind of cache that just eats up memory. Thanks to Daniel Seidewitz for the patch.
Date Thu, 24 Jul 2014 13:22:51 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x b25b375fc -> 740021954
  refs/heads/camel-2.13.x 3b17bd3c9 -> f39312fd0
  refs/heads/master 89bf25387 -> 7f43263d8


CAMEL-7598: JPA consumer should clear entity manager after flush to avoid any jpa provider
to keep previous polled entities in any kind of cache that just eats up memory. Thanks to
Daniel Seidewitz for the patch.


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

Branch: refs/heads/master
Commit: 7f43263d88bdf7825332cad1c36bc324b90af787
Parents: 89bf253
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 24 15:21:22 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 24 15:21:22 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/component/jpa/JpaConsumer.java  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7f43263d/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
index 8682e4b..483c311 100644
--- a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
+++ b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
@@ -135,6 +135,8 @@ public class JpaConsumer extends ScheduledBatchPollingConsumer {
                 // commit
                 LOG.debug("Flushing EntityManager");
                 entityManager.flush();
+                // must clear after flush
+                entityManager.clear();
                 return messagePolled;
             }
         });


Mime
View raw message