[jboss-user] [JBoss Seam] - @DataModel annotation + HTTP session replication

radim.tlusty do-not-reply at jboss.com
Thu Jun 7 11:09:42 EDT 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052197#4052197

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052197



More information about the jboss-user mailing list