1 Reply Latest reply on Sep 6, 2010 9:58 AM by Neil Richardson

    Factory annotation issue

    Deesha Singh Newbie

      Hi guys,


      I'm working on a seam application in eclipse and was using the @Factory annotation. It worked fine, every time I went to a certain page the list that was on that page refreshed and updated etc. Everything was going great, until suddenly.. @Factory was only being called once. If I hit the link to the page, @Factory is called and the list loads properly. But then if I make any changes to the list, all of a sudden the @Factory doesn't get called anymore and i have to redeploy to get the @Factory called so the list is updated.


      I hope that makes sense..


      Anyone know what happened?


      Thanks

        • 1. Re: Factory annotation issue
          Neil Richardson Newbie

          Factories are used to create resource if they don't already exist. If you request a resource (using EL in a JSF page for example) then Seam will attempt to find the resource in of the scope contexts. If it can't find it then it'll try to create the resource - factories are one way of creating resources - so it'll call the factory and then store the result in a scope context.


          It sounds like your storing the result of the factory in a long-running scope (eg. conversation, session or application) so Seam won't need to call the factory again because it can already find an instance of the resource in one of the scope contexts. Check the scope of the Seam component containing the factory method - use STATELESS or EVENT if you want it to refresh for different page requests.