Back Forum Reply New

OpenSessionInViewFilter + HibernateSearch

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:Code:       Query query = getSession().createQuery(HQL);       return query.list();
And i have the session in view. Ok, fine!

When i use Hibernate Search i will need some easy thing.
If i use:Code:
FullTextSession fullTextSession = Search.createFullTextSession(this.getSession());
QueryParser parser = new QueryParser(quot;namequot;, new StandardAnalyzer());
Query query = parser.parse(quot;Cristianquot;);
org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery(query, User.class);
return hibQuery.list();
Fine, is ok!
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.
¥
Back Forum Reply New