-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Search: Analyzer reading from database
PostPosted: Tue Apr 15, 2008 3:53 am 
Beginner
Beginner

Joined: Thu Feb 28, 2008 4:58 am
Posts: 37
Hello
I've defined my own analyzer. It needs to use synonyms. I've put synonyms in database table, because they need to be editable by users.
Now I don't know how to read synonyms from database in analyzer.
I have defined Seam component with local interface.
I use Seam, but Seam starts much later than analyzers are initialized so I can't use @In. @EJB annotation also doesn't work.
I've tried looking up in JNDI but also no luck.

Maybe there is a way to get EntityManager in analyzer?
How should it be done?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 19, 2008 5:07 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I am not a Seam expert, but have you tried to instantiate/use an EntityController (http://docs.jboss.com/seam/2.0.1.GA/api/org/jboss/seam/framework/EntityController.html)?

Or maybe you can delegate the actual db access in the analyzer to a different class in which you can use seam type injection?

As said - these are just guesses. I am sure someone more familiar with Seam could help you better.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 19, 2008 4:27 pm 
Beginner
Beginner

Joined: Thu Feb 28, 2008 4:58 am
Posts: 37
Seam stuff starts much later, so I can't use it. I'd rather think about Hibernate alone, because from logs it seems it starts just before Hibernate Search.
As a workaround I did everything via JDBC (it's much faster too).


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 29, 2008 6:19 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No Hibernate starts at the same time as Search. But you can do a lazy analyzer that go read the information when it needs it. In this case everything would be initialized.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 30, 2008 1:42 pm 
Beginner
Beginner

Joined: Thu Feb 28, 2008 4:58 am
Posts: 37
how to do "lazy" analyzer?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 30, 2008 5:35 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
"lazy" means it is not going to fetch the needed information wen created, but when first used.

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