[ 
https://issues.apache.org/jira/browse/DELTASPIKE-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083529#comment-14083529
 ] 

Harald Wellmann commented on DELTASPIKE-680:
--------------------------------------------

Pull request: https://github.com/apache/deltaspike/pull/8

> Lazy init should not rely on BeanManagerProvider
> ------------------------------------------------
>
>                 Key: DELTASPIKE-680
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-680
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: Data-Module
>    Affects Versions: 1.0.1
>            Reporter: Harald Wellmann
>
> Trying to work with DeltaSpike Data in OSGi (with on-the-fly OSGification, 
> see DELTASPIKE-660), I found that things break when the TCCL is not set to 
> the classloader of the current repository.
> This is caused by lazy initialization of {{RepositoryComponent}} using 
> {{BeanManagerProvider}}.
> Now the current strategies of {{BeanManagerProvider}} to locate the "current" 
> {{BeanManager}} do not work in OSGi where each bundle may have its own 
> BeanManager and there is no obvious interpretation of "current", and the TCCL 
> is not by default set to anything useful for this problem.
> However, in the context of DeltaSpike Data, is it easy to avoid the 
> {{BeanManagerProvider}} even with lazy initialization. The correct 
> {{BeanManager}} is known when a {{RepositoryComponent}} is instantiated, so 
> its sufficient to keep a reference to this {{BeanManager}} to perform lazy 
> initialization.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to