[
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-362?pag...
]
Sanne Grinovero commented on HSEARCH-362:
-----------------------------------------
Hi, Search 3.1.0.GA requires Hibernate 3.3.x
Could you verify you still experience the problem after correcting the versions?
Having it working in eclipse makes me think you are using different versions than when
running by ant.
When using hibernate-search3.1.0 GA, Search throws
AlreadyClosedException under certain circumstances
-----------------------------------------------------------------------------------------------------
Key: HSEARCH-362
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-362
Project: Hibernate Search
Issue Type: Bug
Components: directory provider
Affects Versions: 3.1.0.GA
Environment: Hibernate 3.2.6 GA, ant 1.7.1
Reporter: S Ravi Bhaskar
The below code throws an AlreadyClosedException when trying to open the lucene index.
Junit test to test it works from eclipse, fails in an ant build.
I suspect it is trying to reuse a handle to the index. Please let me know if you need
more information.
I had to bump back my hibernate search version to 3.0.1 GA, and then it started working.
I am getting by, but would ideally like to use 3.1.0 GA without this exception. I think it
has something to do with
Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); VS
Search.createFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); in
the older version.
String query = "BlahBlahBlah";
org.apache.lucene.queryParser.QueryParser parser = new
QueryParser("ItemTitle", new StandardAnalyzer() );
org.apache.lucene.search.Query luceneQuery;
try {
luceneQuery = parser.parse(query);
} catch (ParseException e) {
// TODO Auto-generated catch block
logger.error(String.format("Error parsing search querystring "));
return null;
}
javax.persistence.Query fullTextQuery =
createFullTextEntityManager().createFullTextQuery(luceneQuery, klass);
List result = fullTextQuery.getResultList(); // return a list of managed
where createFullTextEntityManager() is
public FullTextEntityManager createFullTextEntityManager() {
return
Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager()));
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira