No automatic reindexing when changing a property annotated with @OneToOne(mappedBy = ...) @IndexedEmbedded

Description

This is a more serious variation of that only happens with Hibernate ORM 5.6.12+, 6.1.4+ and 6.2.0+.

Essentially, Hibernate Search is not getting a post-update event when a property annotated with @OneToOne(mappedBy = ...) is modified, so it does not trigger reindexing accordingly.

Activity

Show:

Yoann Rodière September 29, 2022 at 2:01 PM

You can find the whole conversation there:

The gist of it:

  • Hibernate ORM used not to trigger any event for changes to a @OneToOne(mappedBy = ...)

  • it started triggering events in some cases after was fixed

  • Hibernate Search has been relying on that new behavior ever since

  • But has been causing loads of issues, to such a point that the patch was reverted in

  • Moving forward, Hibernate ORM could provide additional events for @OneToOne(mappedBy = ...), but that would probably be a new event type: JPA specifies that @PostUpdate events are about database updates, so we probably don’t want them to be triggered for @OneToOne(mappedBy = ...) .

With that in mind, I’ll work on a limited implementation of , just for non-owning ToOne associations; that should allow us to fix this bug with limited impact on usability and performance.

Fixed

Details

Assignee

Reporter

Components

Sprint

Priority

Created September 28, 2022 at 10:39 AM
Updated February 2, 2023 at 9:10 AM
Resolved October 19, 2022 at 4:03 PM