[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-329) Workers ThreadPools breaks ThreadLocals

Grégoire Rolland (JIRA) noreply at atlassian.com
Tue Feb 3 07:31:39 EST 2009


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

Grégoire Rolland commented on HSEARCH-329:
------------------------------------------

Hello,

I implements a webapp for multiple clients. Each customer must have his database. I use Hibernate Search to search my domain object. 

I can deal with the databases, I implements a custom connection provider, based on ThreadLocal pattern. I want to do the same thing with HSearch.

The client request take this path :
1/ RequestFilter
        - Get Entity Manager Factory  and get or reuse Entity Manager (reuse if there is no new conversation), bind this to the ThreadLocal.
2/ Pass-through client layer
3/ Pass-through business layer
4/ On the integration layer, inject the entity manager, founded in the thread local and do the work. Here the connection provider can choose the correct datasource, and the custom FSDirectory, the correct directory for index reading/writing.

The limitation is I can't use shared index reader and i can't upgrade Hibernate Search to 3.1.0.GA, which provide bugs fixes I need too.

I try to use multiple Entity Manager Factory, but due to huge memory footprint (about 50Mbytes each), it was not an option (or I don't know how to reduce it !!). But it's a problem for scalability.

I hope it's quite clear for you !

thanks ...







> Workers ThreadPools breaks ThreadLocals
> ---------------------------------------
>
>                 Key: HSEARCH-329
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-329
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: directory provider
>    Affects Versions: 3.1.0.GA
>            Reporter: Grégoire Rolland
>
> When Implementing multi-domains (multi-databases) FSDirectory based on thread local (to get the thread environment, database name, etc...), the threadpool used by workers "forgot" the thread local variables on the second call (for searching, indexing). Works great with 3.0.1 release, but not with 3.1.0.GA.

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