davsclaus opened a new pull request, #24793:
URL: https://github.com/apache/camel/pull/24793

   ## Summary
   
   When a JPA consumer uses `nativeQuery` without `resultClass`, results are 
returned as `Object[]`. The default `consumeDelete=true` handler calls 
`em.remove(entityBean)` unconditionally, which throws 
`IllegalArgumentException` on `Object[]` since it's not a managed entity. This 
causes the row to never be deleted and reprocessed on every poll — an infinite 
reprocessing loop.
   
   ## Fix
   
   Added an array type guard to the `consumeDelete` handler, matching the 
pattern already used by `lockEntity()` (line 376) which anticipates `Object[]` 
from native queries. When the entity bean is an array, the delete is skipped — 
the same behavior the `@Consumed` annotation handler achieves via its 
`entityType.isInstance()` guard.
   
   _Claude Code on behalf of davsclaus_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to