# Hibernate ORM

**URL:** https://discourse.hibernate.org/c/hibernate-orm/5.md

[Latest](https://discourse.hibernate.org/latest.md) · [Categories](https://discourse.hibernate.org/categories.md)

---

## [About the Hibernate ORM category](https://discourse.hibernate.org/t/about-the-hibernate-orm-category/12)

<div class="topic-metadata">

**Author:** [@gsmet](https://discourse.hibernate.org/u/gsmet)\
**Replies:** 0\
**Last updated:** [December 11, 2017, 9:59am UTC](https://discourse.hibernate.org/t/about-the-hibernate-orm-category/12 "2017-12-11T09:59:03Z")

</div>

Discussions about Hibernate ORM, the persistence library for relational databases.

---

## [StatelessSession#insertMultiple batch size not applied](https://discourse.hibernate.org/t/statelesssession-insertmultiple-batch-size-not-applied/12464)

<div class="topic-metadata">

**Author:** [@Philippe\_Marschall](https://discourse.hibernate.org/u/Philippe_Marschall)\
**Replies:** 5\
**Last updated:** [November 7, 2026, 4:04pm UTC](https://discourse.hibernate.org/t/statelesssession-insertmultiple-batch-size-not-applied/12464 "2026-11-07T16:04:09Z")

</div>

From reading the Javadoc of StatelessSession and the source of StatelessSessionImpl#insertMultiple it is our understanding that if JDBC batching is globally enabled then #insertMultiple should use the size of the List pa…

---

## [Hibernate Generation Type AUTO Error in Spring boot 4.1.1 and Hibernate 7](https://discourse.hibernate.org/t/hibernate-generation-type-auto-error-in-spring-boot-4-1-1-and-hibernate-7/12463)

<div class="topic-metadata">

**Author:** [@Nitesh\_Tiwari](https://discourse.hibernate.org/u/Nitesh_Tiwari)\
**Replies:** 2\
**Last updated:** [October 30, 2026, 2:41pm UTC](https://discourse.hibernate.org/t/hibernate-generation-type-auto-error-in-spring-boot-4-1-1-and-hibernate-7/12463 "2026-10-30T14:41:32Z")

</div>

let \[dispatcherServlet\] in context with path \[/bs\] threw exception \[Request processing failed: org.springframework.dao. InvalidDataAccessResourceUsageException: could not extract ResultSet \[‘progate.hibernate\_sequence’ …

---

## [How to always generate an upsert query?](https://discourse.hibernate.org/t/how-to-always-generate-an-upsert-query/12448)

<div class="topic-metadata">

**Author:** [@Dragas](https://discourse.hibernate.org/u/Dragas)\
**Replies:** 9\
**Last updated:** [November 6, 2026, 3:13pm UTC](https://discourse.hibernate.org/t/how-to-always-generate-an-upsert-query/12448 "2026-11-06T15:13:42Z")

</div>

Suppose I have following table structure (postgresql) create table zar ( id serial constraint zar\_pk primary key, email text not null constraint zar\_pk\_2 …

---

## [Bug Report: merge()-ing an entity with a one-to-one relationship, derived id on one side and bi-directional cascading throws NPE](https://discourse.hibernate.org/t/bug-report-merge-ing-an-entity-with-a-one-to-one-relationship-derived-id-on-one-side-and-bi-directional-cascading-throws-npe/12459)

<div class="topic-metadata">

**Author:** [@cd1etrich](https://discourse.hibernate.org/u/cd1etrich)\
**Replies:** 1\
**Last updated:** [October 26, 2026, 4:30pm UTC](https://discourse.hibernate.org/t/bug-report-merge-ing-an-entity-with-a-one-to-one-relationship-derived-id-on-one-side-and-bi-directional-cascading-throws-npe/12459 "2026-10-26T16:30:53Z")

</div>

Hi, after upgrading from Hibernate ORM \*\*7.4.1.Final\*\* to \*\*7.4.13.Final\*\* (via Spring Boot 4.1.0 → 4.1.2), \`merge()\` of a new entity graph fails with a \`NullPointerException\` inside Hibernate. With 7.4.1 the same code …

---

## [Unsure how to handle given Java type \[java.time.LocalDateTime\] as TemporalType#TIMESTAMP when one parameter is reused across several attributes sharing an AttributeConverter](https://discourse.hibernate.org/t/unsure-how-to-handle-given-java-type-java-time-localdatetime-as-temporaltype-timestamp-when-one-parameter-is-reused-across-several-attributes-sharing-an-attributeconverter/12444)

<div class="topic-metadata">

**Author:** [@HiMyNameIsIlNano](https://discourse.hibernate.org/u/HiMyNameIsIlNano)\
**Replies:** 5\
**Last updated:** [October 22, 2026, 2:27pm UTC](https://discourse.hibernate.org/t/unsure-how-to-handle-given-java-type-java-time-localdatetime-as-temporaltype-timestamp-when-one-parameter-is-reused-across-several-attributes-sharing-an-attributeconverter/12444 "2026-10-22T14:27:05Z")

</div>

\*\*Affected versions:\*\* 7.4.0.Final – 7.4.11.Final (latest tested). Works on 7.3.2.Final, so this is a 7.4 regression. #### Description I have discovered an issue while developing a library for my company. A JPQL query …

---

## [Potential bug with Hibernate7 on StatefulPersistenceContexte::replaceCollection](https://discourse.hibernate.org/t/potential-bug-with-hibernate7-on-statefulpersistencecontexte-replacecollection/12450)

<div class="topic-metadata">

**Author:** [@Arkhann](https://discourse.hibernate.org/u/Arkhann)\
**Replies:** 3\
**Last updated:** [October 12, 2026, 3:51pm UTC](https://discourse.hibernate.org/t/potential-bug-with-hibernate7-on-statefulpersistencecontexte-replacecollection/12450 "2026-10-12T15:51:39Z")

</div>

Hi everyone. I may have found an issue on hibernate 7 (more precisely, I am using version 7.1.24.Final), that was not there with Hibernate 6.6.42.Final. I made a reproduction case you can find on my github here: Sim…

---

## [Null embedded object creates non null columns](https://discourse.hibernate.org/t/null-embedded-object-creates-non-null-columns/12446)

<div class="topic-metadata">

**Author:** [@Frederic\_Jean-Prost](https://discourse.hibernate.org/u/Frederic_Jean-Prost)\
**Replies:** 6\
**Last updated:** [October 9, 2026, 10:13am UTC](https://discourse.hibernate.org/t/null-embedded-object-creates-non-null-columns/12446 "2026-10-09T10:13:48Z")

</div>

I use wildfly 37 with Hibernate 6.6.19.Final. I have an embeddable object to store price values, either in cash or in percentage (for a financial Bond for example). An empty currency means a price in percent. @Embeddab…

---

## [SYSTIMESTAMP in @Function](https://discourse.hibernate.org/t/systimestamp-in-function/12447)

<div class="topic-metadata">

**Author:** [@zpneun](https://discourse.hibernate.org/u/zpneun)\
**Replies:** 3\
**Last updated:** [October 9, 2026, 8:33am UTC](https://discourse.hibernate.org/t/systimestamp-in-function/12447 "2026-10-09T08:33:45Z")

</div>

Hello all, once upon a time, Hibernate was able to detect database specific functions (like SYSTIMESTAMP) in @Function annotations. Today, for example with 7.4, this ability was removed. Those functions, if not suffixed…

---

## [Regression 6.6 → 7.x: merge() of a managed parent with a cleared orphanRemoval collection throws DetachedObjectException](https://discourse.hibernate.org/t/regression-6-6-7-x-merge-of-a-managed-parent-with-a-cleared-orphanremoval-collection-throws-detachedobjectexception/12360)

<div class="topic-metadata">

**Author:** [@JeffreyDevloo](https://discourse.hibernate.org/u/JeffreyDevloo)\
**Replies:** 9\
**Last updated:** [October 6, 2026, 11:15am UTC](https://discourse.hibernate.org/t/regression-6-6-7-x-merge-of-a-managed-parent-with-a-cleared-orphanremoval-collection-throws-detachedobjectexception/12360 "2026-10-06T11:15:17Z")

</div>

On Hibernate ORM 7.2.19.Final, calling merge() on an already-managed parent whose orphanRemoval = true collection has been emptied throws org.hibernate.DetachedObjectException: Given entity is not associated with the per…

---

## [Intermittent "Could not interpret path expression" on the first HQL parse per JVM (7.4.5.Final, after HHH-19758)](https://discourse.hibernate.org/t/intermittent-could-not-interpret-path-expression-on-the-first-hql-parse-per-jvm-7-4-5-final-after-hhh-19758/12437)

<div class="topic-metadata">

**Author:** [@dingko](https://discourse.hibernate.org/u/dingko)\
**Replies:** 9\
**Last updated:** [September 25, 2026, 1:53pm UTC](https://discourse.hibernate.org/t/intermittent-could-not-interpret-path-expression-on-the-first-hql-parse-per-jvm-7-4-5-final-after-hhh-19758/12437 "2026-09-25T13:53:06Z")

</div>

Hi, We are seeing a rare HQL parse failure that looks like the same class of defect as HHH-19758 (HQL parse failure with SLL can lead to wrong parse), but on a version that already contains that fix. I could not reprodu…

---

## [DB2 z/OS doesn't support boolean parameters](https://discourse.hibernate.org/t/db2-z-os-doesnt-support-boolean-parameters/12440)

<div class="topic-metadata">

**Author:** [@avraham.nissimov](https://discourse.hibernate.org/u/avraham.nissimov)\
**Replies:** 0\
**Last updated:** [September 22, 2026, 1:30pm UTC](https://discourse.hibernate.org/t/db2-z-os-doesnt-support-boolean-parameters/12440 "2026-09-22T13:30:11Z")

</div>

In the newer versions of Hibernate, DB2SqlAstTranslator does not support older versions syntax for boolean expressions. For instance for method visitBooleanExpressionPredicate(), as of version 6.6.26, the implementation…

---

## [Possible change in collection parameter handling between Hibernate 6.2.6.Final and 6.2.25.Final](https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435)

<div class="topic-metadata">

**Author:** [@akhilsb97](https://discourse.hibernate.org/u/akhilsb97)\
**Replies:** 1\
**Last updated:** [September 21, 2026, 1:28pm UTC](https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435 "2026-09-21T13:28:34Z")

</div>

Hi, I am getting the following exception after upgrading my dependencies: org.hibernate.QueryException: Named parameter not bound : types\_1 The exception occurs while executing a paginated query. The stack trace goes…

---

## [SelectionQuery.getResultCount Problem](https://discourse.hibernate.org/t/selectionquery-getresultcount-problem/12434)

<div class="topic-metadata">

**Author:** [@gmatege](https://discourse.hibernate.org/u/gmatege)\
**Replies:** 1\
**Last updated:** [September 21, 2026, 1:25pm UTC](https://discourse.hibernate.org/t/selectionquery-getresultcount-problem/12434 "2026-09-21T13:25:21Z")

</div>

We have a SelectionQuery that throws an exception when getResultCount() is called - Thing is, The query generated (from hql) not only misses some parts but also alters joins… When the SelectionQuery’s getResultList() or…

---

## [Improve NativeQuery to support assignable types and custom mapping handling](https://discourse.hibernate.org/t/improve-nativequery-to-support-assignable-types-and-custom-mapping-handling/12428)

<div class="topic-metadata">

**Author:** [@lyrieek](https://discourse.hibernate.org/u/lyrieek)\
**Replies:** 1\
**Last updated:** [September 16, 2026, 3:02pm UTC](https://discourse.hibernate.org/t/improve-nativequery-to-support-assignable-types-and-custom-mapping-handling/12428 "2026-09-16T15:02:12Z")

</div>

Currently, the code uses resultClass.equals(Map.class), resultClass.equals(List.class), etc. This means if a user passes a specific implementation class (like HashMap.class, ArrayList.class) or a sub-interface, it fail…

---

## [Flushing a StatelessSession](https://discourse.hibernate.org/t/flushing-a-statelesssession/12425)

<div class="topic-metadata">

**Author:** [@zpneun](https://discourse.hibernate.org/u/zpneun)\
**Replies:** 1\
**Last updated:** [September 10, 2026, 8:30am UTC](https://discourse.hibernate.org/t/flushing-a-statelesssession/12425 "2026-09-10T08:30:34Z")

</div>

In StatelessSessionImpl, the flush() method is empty. This seems logical given the contract that every method call is sent to the database immediately — in this case, a flush would be unnecessary. However, a stateless s…

---

## [Performance degradation after upgrading Hibernate from 6 to 7 cause of early acquisition of physical connection](https://discourse.hibernate.org/t/performance-degradation-after-upgrading-hibernate-from-6-to-7-cause-of-early-acquisition-of-physical-connection/12422)

<div class="topic-metadata">

**Author:** [@art.kobelev](https://discourse.hibernate.org/u/art.kobelev)\
**Replies:** 3\
**Last updated:** [September 7, 2026, 3:59pm UTC](https://discourse.hibernate.org/t/performance-degradation-after-upgrading-hibernate-from-6-to-7-cause-of-early-acquisition-of-physical-connection/12422 "2026-09-07T15:59:37Z")

</div>

Hi all! I discovered that my application’s performance had degraded by about 15% after 6-\>7 upgrade. After some investigation, I found the cause: early acquisition of physical connection for each SELECT query. JdbcSele…

---

## [orphanRemoval=true triggers loading of never-touched lazy @OneToMany collections on save() of a detached entity (Hibernate 5 → 6.6.53 regression?)](https://discourse.hibernate.org/t/orphanremoval-true-triggers-loading-of-never-touched-lazy-onetomany-collections-on-save-of-a-detached-entity-hibernate-5-6-6-53-regression/12416)

<div class="topic-metadata">

**Author:** [@Sebastian\_G2](https://discourse.hibernate.org/u/Sebastian_G2)\
**Replies:** 5\
**Last updated:** [September 7, 2026, 11:00am UTC](https://discourse.hibernate.org/t/orphanremoval-true-triggers-loading-of-never-touched-lazy-onetomany-collections-on-save-of-a-detached-entity-hibernate-5-6-6-53-regression/12416 "2026-09-07T11:00:26Z")

</div>

Hi everyone, I’m running into unexpected behavior after migrating from Hibernate 5 to Hibernate 6.6.53.Final as part of a Spring Boot 2.7 → 3.x migration. Setup I have a parent entity with several @OneToMany collectio…

---

## [Request for Jira issue-creation permission (Hibernate ORM)](https://discourse.hibernate.org/t/request-for-jira-issue-creation-permission-hibernate-orm/12419)

<div class="topic-metadata">

**Author:** [@mlk](https://discourse.hibernate.org/u/mlk)\
**Replies:** 9\
**Last updated:** [November 8, 2026, 3:27pm UTC](https://discourse.hibernate.org/t/request-for-jira-issue-creation-permission-hibernate-orm/12419 "2026-11-08T15:27:56Z")

</div>

Hi, I have a Jira account on hibernate.atlassian.net but get “you don’t have permission to create issues” when trying to file a bug in the HHH project. I first hit this a few days ago and retried since, but the permissio…

---

## [Why does my cache stay invalid after an update?](https://discourse.hibernate.org/t/why-does-my-cache-stay-invalid-after-an-update/12403)

<div class="topic-metadata">

**Author:** [@Mark\_Wright](https://discourse.hibernate.org/u/Mark_Wright)\
**Replies:** 6\
**Last updated:** [September 3, 2026, 9:22am UTC](https://discourse.hibernate.org/t/why-does-my-cache-stay-invalid-after-an-update/12403 "2026-09-03T09:22:41Z")

</div>

Wildfly 39.0.1 Hibernate 6.6.40 Infinispan 16.0.5 I’m trying to use the hibernte L2C in a clustered wildfly environment. I have two nodes, behind an apache load balancer, using the standalone-ha configuration that wil…

---

## [ORA-01461: can bind a LONG value only for insert into a LONG column](https://discourse.hibernate.org/t/ora-01461-can-bind-a-long-value-only-for-insert-into-a-long-column/12407)

<div class="topic-metadata">

**Author:** [@zpneun](https://discourse.hibernate.org/u/zpneun)\
**Replies:** 3\
**Last updated:** [September 3, 2026, 8:43am UTC](https://discourse.hibernate.org/t/ora-01461-can-bind-a-long-value-only-for-insert-into-a-long-column/12407 "2026-09-03T08:43:34Z")

</div>

Hi all, I’ve got problems putting long Strings (\>32768 chars) into a CLOB field in an Oracle DB. I’ve investigated a little bit and found out that this comes from JDBC and the way how Hibernate uses it. If your SQL is …

---

## [Detach call causing session to bypass L2C](https://discourse.hibernate.org/t/detach-call-causing-session-to-bypass-l2c/12406)

<div class="topic-metadata">

**Author:** [@Houcem\_Eddin\_Hrichi](https://discourse.hibernate.org/u/Houcem_Eddin_Hrichi)\
**Replies:** 1\
**Last updated:** [August 31, 2026, 11:50am UTC](https://discourse.hibernate.org/t/detach-call-causing-session-to-bypass-l2c/12406 "2026-08-31T11:50:03Z")

</div>

Hi guys, I have a simple piece of code where I use and entity manager (2LC enabled with entities marked with @Cache(usage = Read\_Write). I fetch 2 entities Media and Post, I detch them and then try to fetch them again. …

---

## [Syncing data between two processes with JPA and hibernate without refresh](https://discourse.hibernate.org/t/syncing-data-between-two-processes-with-jpa-and-hibernate-without-refresh/12388)

<div class="topic-metadata">

**Author:** [@McModknower](https://discourse.hibernate.org/u/McModknower)\
**Replies:** 6\
**Last updated:** [August 26, 2026, 7:59am UTC](https://discourse.hibernate.org/t/syncing-data-between-two-processes-with-jpa-and-hibernate-without-refresh/12388 "2026-08-26T07:59:25Z")

</div>

I have two processes using the same entities in the same table. When I read the row from process A, then write from process B, then read again from process A, i get the value before the write of B. I know that I can use…

---

## [Join elimination in 7.x skips @SQLRestriction when querying by to-one association id](https://discourse.hibernate.org/t/join-elimination-in-7-x-skips-sqlrestriction-when-querying-by-to-one-association-id/12398)

<div class="topic-metadata">

**Author:** [@vbrown37](https://discourse.hibernate.org/u/vbrown37)\
**Replies:** 5\
**Last updated:** [August 24, 2026, 12:46pm UTC](https://discourse.hibernate.org/t/join-elimination-in-7-x-skips-sqlrestriction-when-querying-by-to-one-association-id/12398 "2026-08-24T12:46:48Z")

</div>

Hello, @SQLRestriction no longer applied when filtering by associated entity id after Hibernate 6 → 7 upgrade Versions From: Hibernate ORM 6.6.53.Final To: Hibernate ORM 7.2.19.Final Description After upgrading, a que…

---

## [Regression Issue Hibernate 7.x - HTE (temporary) tables use Java field name instead of Column name](https://discourse.hibernate.org/t/regression-issue-hibernate-7-x-hte-temporary-tables-use-java-field-name-instead-of-column-name/12380)

<div class="topic-metadata">

**Author:** [@haj0136](https://discourse.hibernate.org/u/haj0136)\
**Replies:** 4\
**Last updated:** [August 20, 2026, 8:31am UTC](https://discourse.hibernate.org/t/regression-issue-hibernate-7-x-hte-temporary-tables-use-java-field-name-instead-of-column-name/12380 "2026-08-20T08:31:37Z")

</div>

In Hibernate 7.x, there is a change in creating temporary tables (HTE) for batch inserts. Hibernate reads raw Java field names instead of real column names during creation of HTE tables. So if you have different column n…

---

## [Hibernate 6.6.46.Final: byte code enhancer fails on final entity classes](https://discourse.hibernate.org/t/hibernate-6-6-46-final-byte-code-enhancer-fails-on-final-entity-classes/12390)

<div class="topic-metadata">

**Author:** [@ronby](https://discourse.hibernate.org/u/ronby)\
**Replies:** 14\
**Last updated:** [August 19, 2026, 5:19pm UTC](https://discourse.hibernate.org/t/hibernate-6-6-46-final-byte-code-enhancer-fails-on-final-entity-classes/12390 "2026-08-19T17:19:42Z")

</div>

Hello, I am using Hibernate 6.6.46.Final and i have configured the compile time byte code enhancer maven plugin. On server startup i’ve got the following error on a final entity class: Caused by: java.lang.IllegalArgum…

---

## [Adapt Hibernate ORM 7.4 for GaussDB version 505.2](https://discourse.hibernate.org/t/adapt-hibernate-orm-7-4-for-gaussdb-version-505-2/12378)

<div class="topic-metadata">

**Author:** [@plafaith\_zhang](https://discourse.hibernate.org/u/plafaith_zhang)\
**Replies:** 3\
**Last updated:** [August 15, 2026, 4:28am UTC](https://discourse.hibernate.org/t/adapt-hibernate-orm-7-4-for-gaussdb-version-505-2/12378 "2026-08-15T04:28:30Z")

</div>

PR: Adapt for GaussDB version 505.2. by plafaithing · Pull Request #13143 · hibernate/hibernate-orm · GitHub Background Part of adapting Hibernate ORM (fork-7.4) for GaussDB. GaussDB 505.2 exposes two compatibility mo…

---

## [Hibernate.transactions{result="failure"} can transiently go negative, breaking the whole Prometheus scrape (Micrometer 1.14+)](https://discourse.hibernate.org/t/hibernate-transactions-result-failure-can-transiently-go-negative-breaking-the-whole-prometheus-scrape-micrometer-1-14/12391)

<div class="topic-metadata">

**Author:** [@jongsu](https://discourse.hibernate.org/u/jongsu)\
**Replies:** 5\
**Last updated:** [August 14, 2026, 2:29pm UTC](https://discourse.hibernate.org/t/hibernate-transactions-result-failure-can-transiently-go-negative-breaking-the-whole-prometheus-scrape-micrometer-1-14/12391 "2026-08-14T14:29:22Z")

</div>

(I’d normally file this in JIRA, but my Atlassian account created several days ago still cannot create issues in HHH despite waiting as suggested in this thread - so reporting here. Happy to move it to JIRA once my acco…

---

## [How silent some log type?](https://discourse.hibernate.org/t/how-silent-some-log-type/12323)

<div class="topic-metadata">

**Author:** [@Philippe\_Kernevez](https://discourse.hibernate.org/u/Philippe_Kernevez)\
**Replies:** 5\
**Last updated:** [August 13, 2026, 1:37pm UTC](https://discourse.hibernate.org/t/how-silent-some-log-type/12323 "2026-08-13T13:37:48Z")

</div>

We have WARN logs produced by Hibernate that are just noise for us. Mainly: WARN Batch containing %s statements could not be sorted (might indicate a circular entity relationship) Because we have a few cases with a g…

---

## [Minor error in the documentation?](https://discourse.hibernate.org/t/minor-error-in-the-documentation/12384)

<div class="topic-metadata">

**Author:** [@t\_heit](https://discourse.hibernate.org/u/t_heit)\
**Replies:** 2\
**Last updated:** [August 12, 2026, 7:46pm UTC](https://discourse.hibernate.org/t/minor-error-in-the-documentation/12384 "2026-08-12T19:46:09Z")

</div>

According to section “8.1. Tuning the connection pool” in the Short Guide to Hibernate 7, table “8.2: Settings for configuring Agroal” there’s a property “hibernate.agroal.idleValidationTimeout”. In the source code clas…

[Next page](https://discourse.hibernate.org/c/hibernate-orm/5.md?page=1)
