0 Replies Latest reply on Jun 7, 2007 11:09 AM by radim.tlusty

    @DataModel annotation + HTTP session replication

    radim.tlusty

      I have question about usage of @DataModel annotation on attributes of session/conversation scoped Seam components (I use scoped Spring bean).

      The code looks like following:

       @Name("component")
       @Scope(ScopeType.CONVERSATION)
       public class MyComponent {
      
       @DataModel
       List items;
      
       @Factory("item")
       private void loadItems() {
       ...
       }
      
       }
      


      As I understand the principle of the @DataModel annotation, it does in this case following:
      -- wraps the instance of items to serializable ListDataModel from Seam
      -- outjects the data model instance to the same scope as the component (=conversation)

      Since conversation data are stored in HTTP session, I think I have here in session the list object represented two times - once as part of my component and second as reference in outjected data model. Till to time, that the HTTP session is not replicated it's OK, because both - data model and seam component - references the same instance.

      But what happens on session replication? How is session replicated e.g. in Tomcat? Is it replicated as complete serialized session object (bigger, but preserves relations of objects inside of session) or individually by attribute (which will cause, that data model and Seam component will both point to another reference)?

      I found this problem, because I wrote servlet filter which checks how the system behaves with serialized/deserialized session and I work with each session attribute individually ...

      TIA
      Radim