LazyInitializationException while indexing

Description

I am not sure, if you consider this as a bug or as invalid usage.
But in my view (the view of a user) it is clearly a bug.

I have implemented a custom bridge, that collects all fields of associated classes, that are named "ALL". The goal is, to create an all-field, that spans the parent-class and all its associated classes.

The custom bridge works fine for all "normal" fields of the parent class and the first associated class.

But if the associated class contains another associated class, a LazyInitializationException is raised, when indexing with MassIndexer.startAndWait():

I suspect, that the Exception might also be thrown, when indexing an not fully initalized entity asynchronously.

Nevertheless, the little project in the attachement calls MassIndexer.startAndWait() to demonstrate the issue.

This bug might be related to https://hibernate.onjira.com/browse/HSEARCH-689

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Kai Moritz

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major
Configure