-->
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: Asynchronous updates due to multiple servlets
PostPosted: Thu Oct 01, 2009 6:28 pm 
Newbie

Joined: Thu Sep 17, 2009 5:43 pm
Posts: 7
I'm deploying one war that has three servlets defined in the web.xml - a Spring MVC servlet, a Spring Web Flow servlet, and a RESTEasy servlet. They all use the same middle tier code, using Hibernate EntityManager 3.4.0.GA and Hibernate Search 3.1.1.GA (and Lucene 2.4.1).

If the same servlet updates an indexed entity and then searches for it, all is well -- the newly saved document is found.

But if one servlet creates a new entity (e.g., the MVC servlet, which is responsible for much of the data maintenance), the other servlets cannot see it (e.g., the SWF servlet). If I forcibly reindex the database (which is done via a call to a REST resource), then all is synched up again, and, for example, the SWF servlet can find the the entity indexed via the MVC servlet.

I suspect I need to get the correct ReaderProvider or figure out how to reopen the IndexedReader, but I'm not having any luck. I tried setting hibernate.search.reader.strategy to not-shared, and verified via the debugger that strategy is being applied, but still get the same results.

Any ideas on how I can solve this? For the time being, it looks like I need to keep deploying these servlets in this manner, and they're all responsible for different parts of the lifecycle of the data I need to manage with Hibernate Search/Lucene.


Top
 Profile  
 
 Post subject: Re: Asynchronous updates due to multiple servlets
PostPosted: Thu Oct 01, 2009 7:10 pm 
Newbie

Joined: Thu Sep 17, 2009 5:43 pm
Posts: 7
And after all that, I finally found out the real cause of the problem was that the entity properties I was searching on weren't being hydrated before the save, so they weren't being indexed. That's why the other processes couldn't find them until I did the full index, which was hydrating the properties I needed as part of the indexing process.

All works now as I'd expect, and I can even us the default shared strategy.


Top
 Profile  
 
 Post subject: Re: Asynchronous updates due to multiple servlets
PostPosted: Fri Oct 02, 2009 6:04 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
All works now as I'd expect, and I can even us the default shared strategy.

Nice :-)

_________________
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.  [ 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.