Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7598

Camel does not clear the jpa session after each processed message batch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.3
    • 2.12.5, 2.13.3, 2.14.0
    • camel-jpa
    • None
    • Unknown

    Description

      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.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            dseidewitz Daniel Seidewitz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: