ramu11 commented on PR #27314:
URL: https://github.com/apache/camel/pull/27314#issuecomment-5994726294
> Thanks for the rework onto native Hibernate 8 - dropping camel-jpa/Spring,
the query header, the reflection before delete and `consumeDelete` addresses
most of my earlier review. A few things still need changes:
>
> **From my previous review**
>
> * **Parent dependencyManagement (6):** `parent/pom.xml` still adds
jakarta.persistence-api, hibernate-core `${hibernate-version}`, spring-orm and
h2. That pins versions for every module, and the component doesn't even use the
managed hibernate-core version. Please keep these versions local to the
component.
> * **Consumer failure handling (2):** in `HibernateConsumer` one failed
exchange still throws and rolls back the whole poll. And with `consumeDelete`
gone and no "mark processed" step, every poll re-reads the same rows.
> * **Headers (8):** there is still no `headersClass` on the endpoint, and
`CamelHibernateParameters` has no `@Metadata`, so the header isn't documented.
>
> **New**
>
> 1. **Self-deadlock with `skipLocked`:** the consumer holds
PESSIMISTIC_WRITE row locks while the exchange is routed. A route that updates
the same row through another `hibernate:` endpoint opens a separate session on
the same thread and blocks on the consumer's own lock until the lock timeout,
e.g.
`from("hibernate:X?selectionQuery=...&skipLocked=true").to("hibernate:X?mutationQuery=update
X set done=true where id=:id")`.
> 2. **`streaming` and resource lifetime:** the session, transaction and
JDBC connection are only released when the returned `Stream` is closed. If the
route fails before consuming it, or iterates it without closing (e.g. a split),
the connection is never returned to the pool.
> 3. **Stateless operations ignore the tenant:** `openStatelessSession()`
doesn't apply `tenantIdentifier`, so insert/upsert with multi-tenancy either
fails or writes outside the configured tenant.
> 4. **Docs build:** "unterminated listing block" in
`hibernate-component.adoc` (around line 391).
> 5. **Pre-release dependencies:** Hibernate `8.0.0.Beta3` and
jakarta.persistence `4.0.0-M7` can't ship in a Camel release; we should only
target Hibernate 8 once it is GA (as also raised by Croway).
> 6. **Minor:** options lack `label` (consumer/producer), and
`statelessOperation` is a free-form String where an enum would give validation
and tooling support.
>
> Also, please answer the question from my earlier review on whether AI
assistance was used, so it can be attributed in the commit.
Thanks for the review. Addressed the applicable items in `3d9a12f25e7c`:
* Moved Hibernate/Jakarta dependencies to `camel-hibernate`.
* Fixed per-exchange consumer failure handling.
* Added `headersClass` and header metadata.
* Fixed `skipLocked` self-deadlock via Session reuse.
* Fixed streaming resource cleanup.
* Fixed tenant handling for stateless operations.
* Fixed the documentation listing issue.
* Added producer/consumer option labels.
* Kept `statelessOperation` as a validated String to avoid unnecessary API
changes.
Hibernate 8/Jakarta GA versioning will be updated once the approved GA
baseline is available. Full Camel/Spring/JTA transaction joining remains
intentionally deferred.
All **30/30 tests pass**.
--
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]