You can find the whole conversation there: https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/Events.20on.20change.20of.20non-owning.20side.20of.20associations 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 https://hibernate.atlassian.net/browse/HHH-14216 was fixed
- Hibernate Search has been relying on that new behavior ever since
- But https://hibernate.atlassian.net/browse/HHH-14216 has been causing loads of issues, to such a point that the patch was reverted in https://hibernate.atlassian.net/browse/HHH-15045
- 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 https://hibernate.atlassian.net/browse/HSEARCH-3567 , just for non-owning ToOne associations; that should allow us to fix this bug with limited impact on usability and performance. |