Skip to content

update hibernate up to the latest non-patched version - #1583

Merged
xael-fry merged 3 commits into
playframework:masterfrom
aleksandy:upgrade-hibernate
Nov 11, 2026
Merged

xael-fry merged 3 commits into
playframework:masterfrom
aleksandy:upgrade-hibernate

Conversation

@aleksandy

Copy link
Copy Markdown
Contributor

Summary

Removes the Play-patched hibernate-core jar and its build infrastructure, migrating the framework to a vanilla Hibernate ORM 7.4.14.Final. The Play-specific flush semantics (JPABase.willBeSaved), previously injected via a source patch of hibernate-core, are now implemented in the framework itself as forked flush event listeners, registered programmatically at bootstrap.

Play flush semantics as framework code (instead of patching Hibernate)

  • play.db.jpa.PlayAbstractFlushingEventListener — fork of Hibernate 7.4 AbstractFlushingEventListener with two Play changes: skip flush-time cascades for JPABase entities with willBeSaved == false, and veto collection recreate/remove/update actions for collections whose owner (or the entity being saved) is not going to be saved

  • PlayFlushEventListener / PlayAutoFlushEventListener — forks of DefaultFlushEventListener / DefaultAutoFlushEventListener (the latter is required, otherwise auto-flush on queries would use vanilla cascades)

  • PlayHibernateIntegrator registers them for EventType.FLUSH / EventType.AUTO_FLUSH; wired from JPAPlugin via JpaSettings.INTEGRATOR_PROVIDER (accepted as an instance, no ServiceLoader needed)

  • Each fork file contains the upstream 7.4.14 source kept as close to original as possible, with every Play change wrapped in // [play] ... // [/play] markers; framework/patches/hibernate-7.4.14-patch-play-fork.patch + README record the changes and document the upgrade workflow (copy upstream sources → rename → apply patch)

@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@xael-fry
xael-fry self-requested a review October 31, 2026 17:16
@xael-fry
xael-fry merged commit 48068dc into playframework:master Nov 11, 2026
11 checks passed
@xael-fry xael-fry added feature improvement dependencies Pull requests that update a dependency file labels Nov 11, 2026
@xael-fry xael-fry added this to the 1.12.0 milestone Nov 11, 2026
@aleksandy
aleksandy deleted the upgrade-hibernate branch November 11, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TransientObjectException on auto-flush for entities that were never save()d (1.11.0 / Hibernate 6.6)

2 participants