5 Replies Latest reply on Oct 14, 2007 4:56 AM by Adam Warski

    Injecting a narrower-scoped bean into a wider-scoped bean

    Adam Warski Master

      Hello,

      I looked through the manual, but couldn't find an answer.

      Let's say I have beans with following scopes:
      * A - application
      * S - stateless
      * C - conversation

      In the examples I have often seen C-beans are injected into S-beans. As I understand, this is correct wrt to concurrent requests, that is, Seam will create enough copies of S-beans so that an S-bean serves at most one request at a time (if that wasn't true, and two requests invoked a method on an S-bean at the same time, one injected value would overwrite the other...)?

      Creating additional beans isn't possible with A-beans however: Seam can create at most one A-bean. So I suppose injecting a C-bean into an A-bean should produce an error, or at least a warning, right?

      --
      Regards,
      Adam