-
1. Re: Outjection problems with interface variables
pmuir Feb 11, 2007 1:18 PM (in response to toni)Please show the entities in question
-
2. Re: Outjection problems with interface variables
smokingapipe Feb 11, 2007 1:37 PM (in response to toni)I'm pretty sure I know what's going on.
Your interface is not a Seam-managed entity. Therefore the Seam-entity's scope specification doesn't apply to it. But when you use the real Seam entity, and not the interface, then those rules DO apply and you can't outject it to a wider context than the entity's specified context. Make sense?
Here's an example. java.lang.String is obviously not a Seam entity. Let's say that I have a Seam entity called Book with Conversation scope, and the book implements the Item interface.
I can do this:
@Out(value="foo",scope=whatever) private String myString;
and indeed that string will be outjected. The string is not a Seam-entity so it has no specified scope other than what I specify in the outjection.
If I do this:
@Out(value="foo",scope=Session) private Book myBook;
It won't work because Book has a specified scope (conversation) and cannot be outjected to a wider scope.
But if I do it like this:
@Out(value="foo",scope=Session) private Item myBook;
it's the exact same object, but Item is not a Seam entity, so the outjection works! I think you are seeing inconsistent results because when you use the interface, the Seam scope specification doesn't exist, so you are creating a new one, whereas if you use the Seam-entity you are letting Seam manage it.