I have a vague memory of some bug related to this. But I think there
should exist a testcase if that is a fact, so if it doesn't break any
qi4j-tests/, I think you are Ok to change it.

But I do suspect that there is a deeper problem lurking around,
design-wise I mean.


Cheers

On Tue, Feb 23, 2010 at 12:47 PM, Rickard Öberg <[email protected]> wrote:
> Hi,
>
> I'm running into a problem with dependency injection in entities, and have
> located the problem to be this in EntityInstance:
>    public Object invoke( Object proxy, Method method, Object[] args )
>        throws Throwable
>    {
>        return entityModel.invoke( this, this.proxy, method, args,
> uow.module() );
>    }
> ---
> The call is being made with the UoW module, instead of the module of the
> entity, and so the scope of DI is that of the one who created the UoW,
> rather than the entitys "own" scope. Because what the entity needs is not
> available to the caller the DI fails!
>
> I can't really see why it works like this, and couldn't find any commit
> messages that show it. Niclas, can you remember if there was any thought to
> this, or if it's just a random bug? Would it be ok to change "uow.module()"
> to "module", so that all DI in the entity is done from the entity scope?
>
> /Rickard
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>



-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to