hardy.ferentschik wrote:
Which transaction manager are you using. One of the biggest problems people have using Spring and Hibernate Search is configuring the transaction manager correctly. See for example
viewtopic.php?f=9&t=998155If you do a search you will find many more similar posts.
However, I would expect in this case that no automatic indexing would occur, but you seem to imply that only the first few entities are not indexed and afterwards it works.
I would check transaction management first. Also you should be able to get some Hibernate debug trace. Don't you see any Hibernate log messages?
I think I have a little different situation from the post you give above in that the vast majority of my entities do get indexed. It's just the first several entity-saving transactions that sometimes don't index the entities. I'm using the following transaction manager:
org.springframework.orm.hibernate3.HibernateTransactionManager
I would guess this is an issue where hibernate is not calling the "post-insert" event listeners always in the beginning? Seems strange though why it wouldn't... Again, manually indexing the entities
always works perfect. And saving entities individually through a webpage always seems to work perfect as well as far as indexing goes.
This is really a big problem for us as our data set is very large and we can't continuously manually index every entity.
For the hibernate log messages, this is what I see at the moment I insert one of the entities I want indexed:
Code:
2010-03-12 15:55:28,294 DEBUG [http-8080-1] SQL - insert into Person (Deleted, Primary_Name_Id, Email, Male, Description, Media_Hosting, FamilySearch_User, Fami
lySearch_Session, FamilySearch_Session_Used, FamilySearch_Id, Activity_Score, Activity_Added_People, Activity_Changed_People, Activity_Added_Email, Activity_Sco
re_Past_Month, Activity_Added_People_Past_Month, Activity_Changed_People_Past_Month, Activity_Added_Email_Past_Month, Activity_Posts, Activity_Remembrances, Log
in_Password, Login_Token, Login_Enabled, Login_Created_Date, Login_Verified_Date, Last_Login_Encouragement_Notification_Date, Profile_Image_in_Id, Language_Id,
Birth_Event_Id, Birth_Order, Death_Event_Id, Change_Id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2010-03-12 15:55:28,303 DEBUG [http-8080-1] IdentifierGeneratorFactory - Natively generated identity: 97
2010-03-12 15:55:28,303 DEBUG [http-8080-1] AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2010-03-12 15:55:28,303 DEBUG [http-8080-1] EventSourceTransactionContext - No FullTextIndexEventListener was registered
2010-03-12 15:55:28,303 DEBUG [http-8080-1] EventSourceTransactionContext - No FullTextIndexEventListener was registered
2010-03-12 15:55:28,307 DEBUG [http-8080-1] AbstractSaveEventListener - executing identity-insert immediately
So the "No FullTextIndexEventListener was registered" log statement is after every single entity, even the ones whose indexes were created properly. Don't know what it means... Is this a clue to what's going on?
Finally, is it possible hibernate search doesn't work well with Spring 3.0.1?