If I delete a row from the data base while the index is being built, an exception appears:
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: com.mycompany.MyBusinessObject#17365
at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl .java:377)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener. java:145)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventLi stener.java:195)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListene r.java:103)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557)
at org.hibernate.type.EntityType.resolve(EntityType.java:379)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.loadSingleRow(Loader.java:288)
at org.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImp l.java:231)
at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:100)
at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexe r.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:120)
... 11 more
This causes the whole indexing process to stop.
It would be very useful to me if org.hibernate.ObjectNotFoundException would be handled in a way that does not cause the indexing to stop. An error message would be sufficient.