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.

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 6, 2008 at 5:33 PM
Updated November 13, 2008 at 6:08 PM
Resolved January 7, 2008 at 3:43 PM