-->
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.  [ 5 posts ] 
Author Message
 Post subject: Purge an object failed
PostPosted: Mon Aug 10, 2009 9:58 am 
Newbie

Joined: Mon Aug 10, 2009 9:34 am
Posts: 2
Hello,

After testing, I am sure in my application, the purge method failed without display error.
Here the code here the code seach:

FullTextSession fullTextSession = Search.getFullTextSession(session);
Transaction tx = fullTextSession.beginTransaction();

try
{
// create native Lucene query
.........
// execute search
List result = hibQuery.list();

SearchResult searchResult = new SearchResult();
searchResult.setList(result);
searchResult.setNbResults(hibQuery.getResultSize());

return searchResult;
}
catch (ObjectNotFoundException e)
{
fullTextSession.purge(TipsArticle.class, e.getIdentifier());
throw e;
}
finally
{
tx.commit();
}


When i launch the search, objetnotfoundex is throwed with an Id (yes the object not in DB). But when I retry again : the same exception is done with the same Object ID ??? That why I think my Object wasn't be purged.
Have you an idea to fix my problem ?

For more info:
- I use indexing manually
- I created my lucene index with a batch way.
- I don't use hibernate annotations for mapping
- My DB is Mysql
- I noted with Luke tool, that my lucene index was locked.
- I work with eclispe- hibernate synchronizer - hibernate search 3.1.1.GA

Thanks for response (and sorry for my english language).


Top
 Profile  
 
 Post subject: Re: Purge an object failed
PostPosted: Mon Aug 10, 2009 5:40 pm 
Newbie

Joined: Mon Aug 10, 2009 9:34 am
Posts: 2
Ok I found my error:
I was putting @Id instead of @DocumentId on my entity identifier, however I was not using javax.persistence API.
In this way, I note the indexer works correctly however purger fails.


Top
 Profile  
 
 Post subject: Re: Purge an object failed
PostPosted: Wed Aug 12, 2009 9:09 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
so you were using
Quote:
@Id
from
Quote:
javax.persistence.Id
?

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


Top
 Profile  
 
 Post subject: Re: Purge an object failed
PostPosted: Wed Aug 12, 2009 1:27 pm 
Newbie

Joined: Mon Aug 10, 2009 5:03 pm
Posts: 3
When i launch the search, objetnotfoundex is throwed with an Id (yes the object not in DB). But when I retry again : the same exception is done with the same Object ID ??? That why I think my Object wasn't be purged.
Have you an idea to fix my problem ?

Shamwow


Top
 Profile  
 
 Post subject: Re: Purge an object failed
PostPosted: Thu Aug 13, 2009 6:53 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Could you provide a testcase or post the relevant code of your entities? I can't help you much if I can't reproduce the problem.

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.