The WIA book and other example apps I've found online often show a
User object being stored in the session:

class BlogSession extends WebSession {
  private User user;
}

But does it make sense to do this if your User object is loaded from a
persistence layer (Hibernate) and can contain a large tree of
dependent objects?  For instance, what if my User object has a
hierarchy like this:

User
  Name
  Password
  Set<Blog>
    Blog
      Set<BlogEntry>
        BlogEntry
          Set<Tag>
      Set<Tag>

Would this store the entire hierarchy of blogs, tags, blog entries,
etc. into the session?  I've been experimenting with storing an LDM
of the user in the session instead of the User directly:

class BlogSession extends WebSession {
  private DetachableUserModel userModel;
}

But I'm getting Hibernate LazyInit errors.  So it leaves me wondering
if LDMs in Session aren't automatically loaded since it isn't a
Component.  I haven't really dug into what is going on yet.  I first
wanted to find out what is common practice for a situation like this.

Oh, and this isn't my actual User object -- just and example for
illustrative purposes.  I'm not building a blog, and the properties
and sets of objects in my User need to be there.

Thanks!
Tauren

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to