You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Daniel Seidewitz (JIRA)" <ji...@apache.org> on 2014/07/14 15:00:06 UTC

[jira] [Created] (CAMEL-7598) Camel does not clear the jpa session after each processed message batch

Daniel Seidewitz created CAMEL-7598:
---------------------------------------

             Summary: Camel does not clear the jpa session after each processed message batch
                 Key: CAMEL-7598
                 URL: https://issues.apache.org/jira/browse/CAMEL-7598
             Project: Camel
          Issue Type: Bug
          Components: camel-jpa
    Affects Versions: 2.12.3
            Reporter: Daniel Seidewitz


We are using apache camel to poll from a database. As we want processed rows only to be updated we have disabled consumeDelete on the JPA endpoint. 

During testing we found a large memory leak: all polled entities are kept in the session cache (we are using hibernate as persistence provider). 

The issue seems to be in the JpaConsumer. In method poll() it calls enitityManager.joinTransaction() at the beginning and entitiyManager.flush() at the end of the method but it never calls  entityManager.clear(). As camel is reusing the underlying session during each poll() this causes the first level entity cache to grow indefinitely. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)