ObjectLoader doesn't catch javax.persistence.EntityNotFoundException

Description

If an entity id is present in the search index but not in the database, this exception bubbles up to the top and the app crashes:

Caused by: javax.persistence.EntityNotFoundException: Unable to find org.jboss.seam.wiki.core.model.WikiDocument with id 1330
at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:109)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:79)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:68)
at org.hibernate.Hibernate.initialize(Hibernate.java:306)
at org.hibernate.search.engine.ObjectLoader.load(ObjectLoader.java:49)
at org.hibernate.search.query.FullTextQueryImpl.list(FullTextQueryImpl.java:244)
at org.jboss.seam.wiki.core.search.WikiSearch.executeSearch(WikiSearch.java:186)

The code in ObjectLoader.java is supposed to prevent this but it only catches org.hibernate.ObjectNotFoundException.

Environment

None

Status

Assignee

Unassigned

Reporter

Christian Bauer

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major
Configure