-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: MassIndexer throws "No row with given identifier..."
PostPosted: Wed May 25, 2011 9:11 am 
Newbie

Joined: Fri Jun 11, 2010 3:00 am
Posts: 14
Hi Sanne,

I have implemented a mass indexer to index records. For some foreign keys we do not have records in reference table. Say if employee is in dept 40, but dept table does not have record for dept_id 40.

In such case MassIndexer throws the following exception, is there a way to ignore in such cases and proceed with next row?

[ERROR] 25 May 2011 18:30:28,193 [Hibernate Search: collectionsloader-1] [org.hibernate.search.batchindexing.EntityConsumerLu
ceneworkProducer.run():103] : error during batch indexing:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.tele.bean.Apps#1]
at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:435)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:189)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:178)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.search.util.HibernateHelper.unproxy(HibernateHelper.java:62)
at org.hibernate.search.engine.impl.HibernateStatelessInitializer.unproxy(HibernateStatelessInitializer.java:48)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:459
)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:552
)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:443)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:380)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.index(EntityConsumerLuceneworkProducer.java:16
0)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.indexAllQueue(EntityConsumerLuceneworkProducer
.java:128)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:99)
at org.hibernate.search.batchindexing.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:107)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
[INFO ] 25 May 2011 18:30:28,224 [main] [org.hibernate.search.impl.SimpleIndexingProgressMonitor.indexingCompleted():88] : Re


Top
 Profile  
 
 Post subject: Re: MassIndexer throws "No row with given identifier..."
PostPosted: Wed May 25, 2011 9:35 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi mkkumar79,
I'm sorry but that's currently not possible. You could use the alternative indexing strategy ( http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#search-batchindex-flushtoindexes ) or contribute a patch to implement this feature; if you do, make sure it's optional to enable, as other users might not like this behaviour (as you're really having bad data).

An alternative, you could fix your data: it's a simple query to remove all stale foreign keys.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: MassIndexer throws "No row with given identifier..."
PostPosted: Mon May 30, 2011 2:49 pm 
Newbie

Joined: Fri Jun 11, 2010 3:00 am
Posts: 14
Thanks Sanne. I will try out for a patch.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.