[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-525) Application hangs, main thread returns but some other thread spawned keeps application from ending

Sanne Grinovero (JIRA) noreply at atlassian.com
Fri May 7 13:17:48 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36972#action_36972 ] 

Sanne Grinovero commented on HSEARCH-525:
-----------------------------------------

sure, the cause is exactly what you guessed in your first comment. the Search engine is spawning some helper threads which are needed to achieve top performance; while you usually don't notice problems when "forgetting" to close the SessionFactory, there still might be problems like leaked resources. The "close()" method was not added for Search alone, it exists since long time. I guess you never noticed it as especially unit tests can't possibly test anything after they're finished ;)
I don't know exactly what could happen or which other plugins and listeners could rely on this (caches, connection pools, whatever you're using), but closing it is for sure the correct way to go.

> Application hangs, main thread returns but some other thread spawned keeps application from ending
> --------------------------------------------------------------------------------------------------
>
>                 Key: HSEARCH-525
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-525
>             Project: Hibernate Search
>          Issue Type: Bug
>    Affects Versions: 3.1.1.GA, 3.2.0.CR1
>         Environment: Ubuntu 9.10, java version "1.6.0_0"
> OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu3)
> OpenJDK Server VM (build 14.0-b16, mixed mode),
> mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using  EditLine wrapper
>            Reporter: ddbattlefield2142
>         Attachments: HibernateSearchBugReport.tgz
>
>
> Write a class with one main method. Call a method which loads one entity (preexisting data) and tries to index it. The code runs fine and the main thread returns but the application hangs. Some thread spawned by hibernate is keeping the application from exiting. You would need to press control + C to exit the application. 
> Please refer to README in the attachment for a list of dependencies I am using and the running instructions. 

-- 
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