Hi,

I'm using guice-persist, guice-servlet and hibernate-search in my 
application.

For testing purposes, I am using an in-memory database (which gets 
automatically populated with hibernate) and would like to index this 
database for hibernate-search.

My problem is the following: PersistService is not started until 
GuiceFilter is initialized (init() method called), so I can't get a 
(FullText)EntityManager until that moment. That means I cannot trigger the 
database indexing just by requiring injection of EntityManager in ony of my 
guice modules because that will occur before the PersistService has been 
started. And If I try to start the PersistService myself, I get an error 
later saying it has already been started.

As workaround, I've added a guice-managed filter (after PersistFilter) that 
will perform the index processing in its init(FilterConfig) method but I 
don't like to do that very much.

I can see 2 possible solutions to that problem:

   - allow PersistService.start() to be called multiple times (as stated by 
   the javadoc), this is a recurring problem
   - have a way to call custom code after GuiceFilter initialization.

Does anybody know another/better way?

Thanks,

Xavier

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to