2 Replies Latest reply on Jun 1, 2009 10:37 PM by Greg Zoller

    Components constructed multiple times?

    Greg Zoller Newbie

      Hello,


      I've noticed that my Seam components are constructed multiple times (sometimes many multiple times).  Why is that?  Below is a log output for a single page render.  The OrderMgr is session scope (Order is created by OrderMgr, so that's 1-to-1).  This object is created twice for the page--should be once.  Same for CartMgr, also a session-scoped component.  Then there's CartLinesScrollerVO, a page-scoped component, which is created 8 times for the single page render!


      Can anyone shed some light as to what's going on? 
      Thanks,
      Greg




      09:53:50,902 INFO  [STDOUT] +++ Creating New OrderMgr +++
      09:53:50,902 INFO  [STDOUT] === Creating new Order!===
      09:53:50,902 INFO  [STDOUT] +++ Creating New OrderMgr +++
      09:53:50,902 INFO  [STDOUT] === Creating new Order!===
      09:53:50,902 INFO  [STDOUT] ::: Creating new CartMgr :::
      09:53:50,902 INFO  [STDOUT] ::: Creating new CartMgr :::
      09:53:50,902 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:50,902 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:52,448 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:52,448 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:54,636 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:54,636 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:56,417 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      09:53:56,417 INFO  [STDOUT] ==== Create new CartLinesScrollerVO ===
      



      CartMgr is referenced only once in the page.  CartLinesScrollerVO (@Name is lineScroller) is accessed only in a rich:dataTable tag.  The Java objects are simple named Seam components--not EJBs or anything.


      OrderMgr isn't even referenced at all (directly or indirectly) on this page!  Will Seam try to construct any session-scoped components ahead of their actual use?