camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/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:52 GMT
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/74002195
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/74002195
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/74002195

Branch: refs/heads/camel-2.12.x
Commit: 740021954723bcaff0d41a7a364570e69631a480
Parents: b25b375
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:22:24 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/74002195/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 9dadbe4..23d9128 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
@@ -124,6 +124,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