Skip to content

Commit 9e5945f

Browse files
committed
Prep for 7.1
1 parent 535be5f commit 9e5945f

File tree

2 files changed

+94
-4
lines changed

2 files changed

+94
-4
lines changed

migration-guide.adoc

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This section describes changes to contracts (classes, interfaces, methods, etc.)
4545

4646
7.0 begins the process of reducing the visibility of `org.hibernate.LockOptions`.
4747
This class was originally exposed as an API, even though it is more properly an SPI.
48-
From an API perspective, `FindOption`, `LockOption` and `RefreshOption` are much better ways to specify that information.
48+
From an API perspective, `FindOption`, `LockOption` and `RefreshOption` are much better ways to specify this information.
4949
The class itself, as well as API methods which expose it, have been deprecated.
5050

5151
However, 2 aspects of `LockOptions` have been completely removed.
@@ -90,12 +90,76 @@ Applications should instead manage both sides of such associations directly as w
9090
Second is a little-known feature called "extended" enhancement.
9191
Applications should instead use proper object-oriented encapsulation, exposing managed state via getters and setters.
9292

93+
Additionally, attempting to re-enhance a class with different options is no longer allowed and will result in a `FeatureMismatchException`.
94+
9395

9496
[[session-getLobHelper]]
9597
=== Session#getLobHelper
9698

9799
The `Session#getLobHelper` method has been marked as deprecated in favor of the static `Hibernate#getLobHelper` and will be removed in a future *major* version.
98100

101+
[[H2-lock-timeout]]
102+
=== WAIT, NO WAIT and SKIP LOCKED for H2
103+
104+
The for-update clause enhancements of H2 2.2.220 are now reflected in the Hibernate ORM dialect, allowing applications to use `wait`, `no wait` and `skip locked` options.
105+
106+
107+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108+
// SPI changes
109+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110+
111+
[[spi-changes]]
112+
== Changes to SPI
113+
114+
[[force-increment]]
115+
=== Force-increment Locking for Version with Custom Generator
116+
117+
A new event type (`FORCE_INCREMENT`) has been added to
118+
`org.hibernate.generator.EventType` to support
119+
`OPTIMISTIC_FORCE_INCREMENT` and `PESSIMISTIC_FORCE_INCREMENT`
120+
when used with `@Version` mappings with custom generators.
121+
122+
123+
[[pessimistic-locking]]
124+
=== Pessimistic Locking
125+
126+
A number of changes have been made to pessimistic locking support.
127+
128+
* Introduction of `org.hibernate.dialect.lock.spi.LockingSupport` which represents a Dialect's support for pessimistic locking.
129+
* Introduction of `org.hibernate.sql.ast.spi.LockingClauseStrategy` to integrate into SQL AST translation.
130+
* Changed standard implementation of `org.hibernate.dialect.lock.LockingStrategy` for pessimistic locking to one using SQL AST.
131+
* Changes to `LockOptions` as <<lock-options,already discussed>>.
132+
133+
[NOTE]
134+
More changes related to pessimistic locking are coming in later 7.x releases.
135+
We've opted to tackle these in stages since they all relate and build on top of each other.
136+
See https://hibernate.atlassian.net/browse/HHH-19551 for details.
137+
138+
[[format-mapper]]
139+
=== JSON FormatMapper Enhancements
140+
141+
JSON mappings on Oracle 21+ will now try to leverage driver built-in OSON decoding to improve JSON parsing performance. In case of trouble, this can be disabled with the `hibernate.dialect.oracle.oson_format_disabled` configuration option.
142+
143+
144+
[[enhancement-option-granularity]]
145+
=== Enhancement Option Granularity
146+
147+
The actual enhancements written into bytecode were previously allowed to vary by class and sometimes even by attribute.
148+
However, all Hibernate tooling only supported setting those "globally" per enhancement.
149+
To this end, all `org.hibernate.bytecode.enhance.spi.EnhancementContext` methods which determine whether certain aspects of enhancement are applied have changed to no longer accept class/attribute.
150+
Specifically:
151+
152+
* `doDirtyCheckingInline(UnloadedClass classDescriptor)` -> `doDirtyCheckingInline()`
153+
* `doExtendedEnhancement(UnloadedClass classDescriptor)` -> `doExtendedEnhancement()`
154+
* `doBiDirectionalAssociationManagement(UnloadedField field)` -> `doBiDirectionalAssociationManagement()`
155+
156+
See also <<enhancement-options>>.
157+
158+
159+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160+
// DDL changes
161+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162+
99163
[[ddl-changes]]
100164
== Changes to DDL generation
101165

whats-new.adoc

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,33 @@ Describes the new features and capabilities added to Hibernate ORM in 7.1.
1010

1111
If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
1212

13-
[[Teradata]]
14-
== TeradataDialect
1513

16-
7.1 adds a Dialect for the Teradata database, supporting version 12 and higher.
14+
[[resource-discovery]]
15+
== Resource Discovery in SE Environments
16+
17+
The Jakarta Persistence specification defines the ability for a provider to discover "managed resources" in EE environments, alleviating the application from manually listing all classes and XML files.
18+
However, it defines no such support in SE environments.
19+
20+
Starting with 7.1, Hibernate now supports this discovery in SE environments, by allowing applications to specify the root URL and zero-or-more "jar" URLs to search.
21+
These URLs correspond to
22+
23+
* `jakarta.persistence.spi.PersistenceUnitInfo#getPersistenceUnitRootUrl`
24+
* `jakarta.persistence.spi.PersistenceUnitInfo#getJarFileUrls`
25+
26+
These URLs are searched for managed resources according to the process defined in https://jakarta.ee/specifications/persistence/3.2/jakarta-persistence-spec-3.2#a12305[the specification].
27+
28+
[[locking]]
29+
== Locking
30+
31+
`org.hibernate.Locking` has been introduced to support various aspects of pessimistic locking:
32+
33+
* `Locking.Scope` is an extension of `jakarta.persistence.PessimisticLockScope` including some Hibernate-specific options.
34+
* `Locking.FollowOn` allows controlling Hibernate's follow-on locking behavior.
35+
36+
Additionally, we've added `org.hibernate.Timeouts` to help deal with some standard `jakarta.persistence.Timeout` values.
37+
38+
39+
[[interceptor-merge]]
40+
== Interceptor and merge
41+
42+
Support for intercepting `Session#merge` events has been added to Hibernate's `Interceptor`.

0 commit comments

Comments
 (0)