Repository navigation
CAMEL-21873: camel-hibernate - document Spring Boot limitation - #28612
Conversation
Spring Boot manages Hibernate ORM 7.x and Jakarta Persistence 3.2, while camel-hibernate requires Hibernate ORM 8 and Jakarta Persistence 4.0. Document the required version overrides and that the starter cannot be combined with Spring Data JPA or the Spring Boot JPA/Hibernate auto-configuration yet.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔁 2 tests passed only after a retry on JDK 21 (2 retried attempts) Recovered flaky tests on JDK 21 (2)
🔬 Scalpel shadow comparison — Scalpel: 8 of 708 tested, 26 compile-only — current: 8 all testedMaveniverse Scalpel detected 8 affected modules (current approach: 8). Skip-tests mode would test 8 modules (2 direct + 7 downstream), skip tests for 26 (generated code, meta-modules) Modules Scalpel would test (8)
Modules with tests skipped (26)
All tested modules (35 modules, 4m 32s total)Total reactor time: 4m 32s
Top 20 slowest modules:
|
oscerd
left a comment
There was a problem hiding this comment.
Useful and accurate addition — thanks for documenting this, it's a sharp edge new camel-hibernate users will hit.
I verified the version claims against the component itself on main (camel-hibernate was added recently under this same CAMEL-21873). The component's pom.xml sets its own hibernate8-version=8.0.0.Beta3 and jakarta-persistence4-api-version=4.0.0-M7 and depends on org.hibernate.orm:hibernate-core and jakarta.persistence:jakarta.persistence-api at exactly those versions — deliberately distinct from the project-wide hibernate-version=7.4.13.Final / jakarta-persistence-api-version=3.2.0 that the rest of the build (and Spring Boot's dependency management) align with. So everything the doc asserts checks out:
- "requires Hibernate ORM 8 and Jakarta Persistence 4.0" and the
8.0.0.Beta3/4.0.0-M7snippet match the component pom exactly; - "Spring Boot provides Hibernate ORM 7.x and Jakarta Persistence 3.2" matches the managed versions;
- the
NoSuchMethodError-at-runtime hazard from that skew is real and well explained, as is the single-ORM/JPA-version-per-application consequence forcamel-jpaetc.
Both the component doc and the generated catalog mirror are updated identically, so the catalog "uncommitted changes" check is satisfied, and CI is green. The internal link uses a same-page <<...>> reference rather than an external camel.apache.org URL — correct per the doc conventions.
Two non-blocking notes:
-
Anchor convention. The new section uses an explicit
[[hibernate-spring-boot]]anchor before the== Using with Spring Bootheading. The project doc conventions (CLAUDE.md) steer away from explicit[[anchor]]blocks before headings: AsciiDoc already derives an id from the heading text (_using_with_spring_boot), and an explicit anchor sets an id without the_prefix, diverging from what the website link checker and any cross-pagexref:expect — it's rare in the tree (only a handful of component docs use it). Since the only reference here is the same-page WARNING at the top, you could drop[[hibernate-spring-boot]]and point that at<<_using_with_spring_boot,Using with Spring Boot>>instead, to stay with the house pattern. Minor, and your call — just flagging the documented convention. -
The user-facing
<properties>snippet hardcodes8.0.0.Beta3/4.0.0-M7. That's the right thing for a copy-paste Spring Boot override, but it will need keeping in sync whenever camel-hibernate bumps Hibernate ORM / Jakarta Persistence (the bullet's "the ones used by this Camel release — see the camel-hibernate dependencies" already carries the version-agnostic guidance).
No blockers.
Claude Code on behalf of oscerd
camel-hibernaterequires Hibernate ORM 8 (8.0.0.Beta3) and Jakarta Persistence 4.0 (4.0.0-M7). Spring Boot 4.1.x manageshibernate.version=7.4.13.Finalandjakarta-persistence.version=3.2.0, so in a Spring Boot applicationcamel-hibernate-starterresolves to versions the component is not compatible with.Compiling
camel-hibernateagainst Hibernate 7.4.13.Final / JPA 3.2.0 fails on two Hibernate 8-only methods, so these fail at runtime withNoSuchMethodError:SelectionQuery.setLockTimeout(Timeout), used by the consumer withskipLocked=trueMutationQuery.execute(), used by producer mutation queriesThe Spring stack is adding Hibernate 8 support but is not there yet for Spring Boot 4.1: Spring Data JPA adapted to JPA 4.0 only in 4.2.0-M2 (spring-projects/spring-data-jpa#4197), and Spring Framework's Hibernate 8
BeanContainerSPI support is in 7.1 (spring-projects/spring-framework#37381).This PR adds a warning-level "Using with Spring Boot" section to the component docs (with a short warning near the Maven dependency pointing to it) explaining:
spring-boot-starter-parentproperties, ordependencyManagementwhen importing the BOM);camel-jpa).Related: apache/camel-spring-boot#2063 (adds the missing
CamelHibernateIT).Claude Code on behalf of Federico Mariani