Well, i have a little question.
I have an application using spring+hibernate. Im using OpenSessionInViewFilter, and now i want to use HibernateSearch in my application.
Using Hibernate i use the session like that:
And i have the session in view. Ok, fine!Code:Query query = getSession().createQuery(HQL); return query.list();
When i use Hibernate Search i will need some easy thing.
If i use:
Fine, is ok!Code:FullTextSession fullTextSession = Search.createFullTextSession(this.getSession()); QueryParser parser = new QueryParser("name", new StandardAnalyzer()); Query query = parser.parse("Cristian"); org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery(query, User.class); return hibQuery.list();
But, who closes this fullTextSession? I dont need to use the fullTextSession.close();???
My code is ok? I will have not got any trouble?
Thanks,
Cristian Ventura.


Reply With Quote