[hibernate-issues] [Hibernate-JIRA] Resolved: (HSEARCH-362) When using hibernate-search3.1.0 GA, Search throws AlreadyClosedException under certain circumstances

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Apr 8 11:08:45 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard resolved HSEARCH-362.
--------------------------------------

    Resolution: Cannot Reproduce

No user feedback

> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list