You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "JiriOndrusek (via GitHub)" <gi...@apache.org> on 2026/09/03 09:14:34 UTC
[PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
JiriOndrusek opened a new pull request, #26074:
URL: https://github.com/apache/camel/pull/26074
Fixes [CAMEL-24615](https://issues.apache.org/jira/browse/CAMEL-24615).
**Requires CAMEL-24604** (#26068), which makes the hibernate profile runnable again — this change is stacked on top of it and fixes the 7 tests that then fail, all rooted in OpenJPA-specific assumptions in the test suite:
- the `camel` unit used `hbm2ddl.auto=create`, which drops the schema whenever an
additional JPA endpoint creates its EntityManagerFactory mid-test; `update` is
additive like OpenJPA's `SynchronizeMappings`
- `AbstractJpaMethodSupport` relied on `em.joinTransaction()`, which enlists only
under OpenJPA — under Hibernate it began a never-committed local transaction, so
cleanup was silently lost; replaced with a plain resource-local transaction (plus
deleting orphaned `Address` rows, as bulk deletes do not cascade)
- a native query asserted positional columns of `select *`, whose column order is
provider-DDL-dependent; it now selects explicit columns
Both profiles green: 119 tests with `-Dhibernate`, 119 by default.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
# Description
<!--
- Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
-->
# Target
- [ ] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
# Tracking
- [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
<!--
# *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
-->
# Apache Camel coding standards and style
- [ ] I checked that each commit in the pull request has a meaningful subject line and body.
<!--
If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
-->
- [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
<!--
You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
# AI-assisted contributions
- [ ] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #26074:
URL: https://github.com/apache/camel/pull/26074#discussion_r3923591785
##########
components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml:
##########
@@ -79,6 +82,18 @@
</properties>
</persistence-unit>
+ <persistence-unit name="keyvalueDb" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.processor.keyvalue.jpa.KeyValueEntry</class>
+
+ <properties>
+ <property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
+ <property name="jakarta.persistence.jdbc.url" value="jdbc:h2:./target/keyvalueTest;DB_CLOSE_DELAY=-1"/>
Review Comment:
This unit uses `jakarta.persistence.jdbc.driver` / `jakarta.persistence.jdbc.url` while all 5 other units in this file use `hibernate.connection.driver_class` / `hibernate.connection.url`. It's also the only unit missing `hibernate.dialect`. Consider aligning for consistency:
```suggestion
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:./target/keyvalueTest;DB_CLOSE_DELAY=-1"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
</properties>
```
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #26074:
URL: https://github.com/apache/camel/pull/26074
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "JiriOndrusek (via GitHub)" <gi...@apache.org>.
JiriOndrusek commented on PR #26074:
URL: https://github.com/apache/camel/pull/26074#issuecomment-5524615455
Thanks for the review!
2. Merge order: #26068 (CAMEL-24604) goes first; this PR will then be rebased onto main — which drops the duplicated 2557e435 from its history — and merged afterwards.
3. The commit message issues (leading spaces, typos) are in 2557e435, i.e. they belong to #26068 — after the rebase that commit will no longer be part of this PR.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26074:
URL: https://github.com/apache/camel/pull/26074#issuecomment-5524062826
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-jpa`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 9 tested, 27 compile-only — current: 9 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **36 affected modules** (current approach: 9).
<details><summary>:warning: Modules only in Scalpel (27)</summary>
- `apache-camel`
- `camel-allcomponents`
- `camel-catalog`
- `camel-catalog-console`
- `camel-catalog-maven`
- `camel-catalog-suggest`
- `camel-componentdsl`
- `camel-endpointdsl`
- `camel-endpointdsl-support`
- `camel-itest`
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-kamelet-main`
- `camel-launcher`
- `camel-report-maven-plugin`
- `camel-route-parser`
- `camel-yaml-dsl`
- `camel-yaml-dsl-deserializers`
- `camel-yaml-dsl-maven-plugin`
- `coverage`
- `docs`
- `dummy-component`
</details>
**Skip-tests mode would test 9 modules** (1 direct + 8 downstream), **skip tests for 27** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (9)</summary>
- `camel-jbang-mcp`
- `camel-jbang-plugin-mcp`
- `camel-jbang-plugin-route-parser`
- `camel-jbang-plugin-tui`
- `camel-jbang-plugin-validate`
- `camel-jpa`
- `camel-launcher-container`
- `camel-yaml-dsl-validator`
- `camel-yaml-dsl-validator-maven-plugin`
</details>
<details><summary>Modules with tests skipped (27)</summary>
- `apache-camel`
- `camel-allcomponents`
- `camel-catalog`
- `camel-catalog-console`
- `camel-catalog-maven`
- `camel-catalog-suggest`
- `camel-componentdsl`
- `camel-endpointdsl`
- `camel-endpointdsl-support`
- `camel-itest`
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-kamelet-main`
- `camel-launcher`
- `camel-report-maven-plugin`
- `camel-route-parser`
- `camel-yaml-dsl`
- `camel-yaml-dsl-deserializers`
- `camel-yaml-dsl-maven-plugin`
- `coverage`
- `docs`
- `dummy-component`
</details>
> :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
<details><summary>All tested modules (36 modules)</summary>
- Camel :: All Components Sync point
- Camel :: Assembly
- Camel :: Catalog :: Camel Catalog
- Camel :: Catalog :: Camel Report Maven Plugin
- Camel :: Catalog :: Camel Route Parser
- Camel :: Catalog :: Console
- Camel :: Catalog :: Dummy Component
- Camel :: Catalog :: Maven
- Camel :: Catalog :: Suggest
- Camel :: Component DSL
- Camel :: Coverage
- Camel :: Docs
- Camel :: Endpoint DSL
- Camel :: Endpoint DSL :: Support
- Camel :: Integration Tests
- Camel :: JBang :: Core
- Camel :: JBang :: Integration tests
- Camel :: JBang :: MCP
- Camel :: JBang :: Main
- Camel :: JBang :: Plugin :: Edit
- Camel :: JBang :: Plugin :: Generate
- Camel :: JBang :: Plugin :: Kubernetes
- Camel :: JBang :: Plugin :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Testing
- Camel :: JBang :: Plugin :: Validate
- Camel :: JPA
- Camel :: Kamelet Main
- Camel :: Launcher
- Camel :: Launcher :: Container
- Camel :: YAML DSL
- Camel :: YAML DSL :: Deserializers
- Camel :: YAML DSL :: Maven Plugins
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/33737753520)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26074:
URL: https://github.com/apache/camel/pull/26074#issuecomment-5523665687
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24615: camel-jpa - Fix the tests failing under the hibernate profile [camel]
Posted by "JiriOndrusek (via GitHub)" <gi...@apache.org>.
JiriOndrusek commented on code in PR #26074:
URL: https://github.com/apache/camel/pull/26074#discussion_r3923755435
##########
components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml:
##########
@@ -79,6 +82,18 @@
</properties>
</persistence-unit>
+ <persistence-unit name="keyvalueDb" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.processor.keyvalue.jpa.KeyValueEntry</class>
+
+ <properties>
+ <property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
+ <property name="jakarta.persistence.jdbc.url" value="jdbc:h2:./target/keyvalueTest;DB_CLOSE_DELAY=-1"/>
Review Comment:
Fixed in a12a6b0 — the `keyvalueDb` unit now uses the same `hibernate.dialect` / `hibernate.connection.*` style as the other units (and matches the new `KeyValueEntryHibernateMappingTest` as well). Full `-Dhibernate` suite re-verified green (119 tests).
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org