You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/07/16 15:09:00 UTC

[jira] [Resolved] (CAMEL-24174) camel-jpa - Parallel EntityManager fix from CAMEL-22534 only covers Splitter, not Multicast/RecipientList/WireTap

     [ https://issues.apache.org/jira/browse/CAMEL-24174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-24174.
---------------------------------
    Resolution: Fixed

> camel-jpa - Parallel EntityManager fix from CAMEL-22534 only covers Splitter, not Multicast/RecipientList/WireTap
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24174
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24174
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jpa
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.22.0
>
>
> CAMEL-22534 fixed a concurrency issue where parallel sub-exchanges in the Splitter shared the same non-thread-safe {{EntityManager}} map (exchange property {{CamelEntityManager}}). The fix strips the {{JPA_ENTITY_MANAGER}} property from sub-exchange copies when {{parallelProcessing}} is enabled, so each branch creates its own dedicated {{EntityManager}}.
> However, the fix was only applied in {{Splitter.java}} (line ~728-731). The same property copy happens in:
> - {{MulticastProcessor}} (used by {{multicast(parallelProcessing)}})
> - {{RecipientListProcessor}} (used by {{recipientList(parallel)}})
> - {{WireTapProcessor}}
> All three copy exchange properties by default, so parallel branches through these EIPs can share the same non-thread-safe {{HashMap<String, EntityManager>}} and the same {{EntityManager}} instances across threads -- both concurrent EM use and map corruption are possible.
> The fix should either:
> - Move the property-stripping into the shared {{MulticastProcessor}} (since Splitter and RecipientList both extend it), or
> - Make the JPA helper's EM map thread-safe / per-thread.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)