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

Work on CAMEL-26147 started by Vignesh Nayak Manel.
---------------------------------------------------
> camel-jpa - a consumer whose query returns scalar values delivers nothing 
> with the default consumeLockEntity=true
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26147
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26147
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jpa
>            Reporter: Claus Ibsen
>            Assignee: Vignesh Nayak Manel
>            Priority: Major
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of jpa (CAMEL-24961, PR #28393).
> h4. 1. A consumer whose query returns scalar values delivers nothing
> With the default {{consumeLockEntity=true}}, {{JpaConsumer.lockEntity}} (main 
> 2a465aa4814c, line 372) calls {{entityManager.lock}} on each result. For a 
> query that selects a column (a String, a Long...) the lock fails, and the 
> catch block returns {{entity.getClass().isArray()}} (line 393), which is 
> false, so {{processBatch}} (line 198) skips every row. The only trace is a 
> DEBUG log, so the route never gets a message and nothing says why. Checked on 
> 4.24.0-SNAPSHOT with OpenJPA and H2.
> Proposed: do not lock (return true) when the result is not an entity, or at 
> least log the skip at WARN.
> h4. 2. Doc: the entity class name is not optional for sending, and a List 
> needs jpa:java.util.List
> The jpa doc says "For sending to the endpoint, the _entityClassName_ is 
> optional", but the path is required ({{JpaEndpoint}}, main 2a465aa4814c, 
> lines 58-60, {{@Metadata(required = true)}}). The doc also says the body may 
> be "a collection or array of entity beans", but a List sent to 
> {{jpa:<Entity>}} fails, because the producer converts the body to the entity 
> type ({{getMandatoryBody(getEntityType())}}, line 608); only 
> {{jpa:java.util.List}} works, which the doc calls "entityType=java.util.List 
> as a configuration". Checked on 4.24.0-SNAPSHOT with OpenJPA and H2.
> Proposed: fix the doc (the path is required; use {{jpa:java.util.List}} for a 
> List), or let the producer accept a collection or array of the entity type.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to