davsclaus opened a new pull request, #24794: URL: https://github.com/apache/camel/pull/24794
## Summary Fixes 5 of 6 medium-severity findings from the July 2026 camel-jpa component review ([CAMEL-24132](https://issues.apache.org/jira/browse/CAMEL-24132)): - **M1**: `receiveNoWait()` no longer delegates to `receive()` with pessimistic locking — refactored into `doReceive(boolean useLocking)` so `receiveNoWait()` runs without locks - **M2**: `receive(timeout)` now calls `future.cancel(true)` on `TimeoutException` so abandoned tasks don't accumulate holding DB locks - **M3**: `setLockMode()` is skipped for native queries, which throw `IllegalStateException` per JPA spec - **M4**: Concurrent insert race in `JpaMessageIdRepository.add()` now catches constraint violations and maps them to `return false` (duplicate detected) instead of failing the exchange. Also removed premature `entityManager.close()` inside the transaction lambda - **M6**: `isUseExecuteUpdate()` now trims query strings and detects update keywords (`INSERT`/`UPDATE`/`DELETE`) instead of select, so queries with leading whitespace or CTEs are correctly classified M5 (parallel EntityManager fix missing from Multicast/RecipientList/WireTap) is tracked separately in [CAMEL-24174](https://issues.apache.org/jira/browse/CAMEL-24174). ## Test plan - [x] All 96 existing camel-jpa tests pass (0 failures) - [ ] Manual verification of M3 with `nativeQuery` + default `consumeLockEntity=true` - [ ] Manual verification of M6 with leading-whitespace and CTE queries _Claude Code on behalf of davsclaus_ Co-Authored-By: Claude Opus 4.6 <[email protected]> -- 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]
