The "Design Patterns" section of the Wiki.....



                                                                                       
                            
                    jiesheng zhang                                                     
                            
                    <jasonnew2001@       To:     [EMAIL PROTECTED]                     
                    
                    yahoo.com>           cc:                                           
                            
                                         Subject:     Re: [Hibernate] Hibernate usage 
question                     
                    11/02/03 05:07                                                     
                            
                    PM                                                                 
                            
                                                                                       
                            
                                                                                       
                            




Hi,
gavin
I will very interested in this topic. Where can I find
the "open session in view" pattern documentation?

Thanks

--- [EMAIL PROTECTED] wrote:
>
> Check out the "open session in view" pattern for
> these kind of simple
> applications.
>
> The basic idea is to use a servlet filter to open
> and close sessions.
>
>
>
>
>
>
>                     Chris Conrad
>
>
>                     <[EMAIL PROTECTED]>
>        To:     [EMAIL PROTECTED]
>
>                     Sent by:
>        cc:
>
>
> [EMAIL PROTECTED]       Subject:
> [Hibernate] Hibernate usage question
>
>                     eforge.net
>
>
>
>
>
>
>
>
>                     11/02/03 11:54 AM
>
>
>
>
>
>
>
>
>
>
>
>
> After reading the Hibernate documentation and
> contributed documentation,
> I have not seen any advice on how to best utilize
> Hibernate for this
> application.
>
> I'm currently working on a community based
> collaboration web
> application.  The architecture is fairly basic, an
> MVC framework
> (probably Struts) for the web tier, local stateless
> session beans for
> the business tier and hibernate for the persistence
> layer.  The problem
> I've run across is this application has many
> entities which are
> inter-related in a potentially large object graph.
> For example, a User
> is associated with 1 or more Communities.  Each
> Community is associated
> with 1 or more Conversations.  Each Conversation can
> have any number of
> Threads, etc.
>
> My question is, what is the best way to manage a
> large object graph like
> this?  The first thought I had was to use lazy
> loading and proxies, but
> since the session is already closed by the time the
> data gets to the web
> tier, that doesn't work.  The Lightweight Class
> pattern seems to
> partially solve the problem but leaves two issues
> unresolved:
>
> 1. It will require a large number of Lightweight
> Classes to avoid
> retrieving unnecessary data from the database.  For
> example, the basic
> user information will be stored in the HttpSession.
> To get the
> Communities related to it, an object mapped just to
> the user's
> Communities relationship will be necessary.  To get
> the Tasks assigned
> to them, an object mapped just to the users Tasks
> relationship will be
> necessary.  Using a heavy weight class with proxies
> and lazy loading
> allows for only 1 object to be used, but then all of
> the data already
> stored in the user's session will be fetched as
> well, adding an extra
> query (1 query for the data I already have, 1 query
> to lazy load the
> data I actually want).
>
> 2. There doesn't appear to be any way to manage
> creating new
> relationships without at least 1 extra query.  If I
> want to add a
> Conversation to a Community, I'll need to load the
> Community (at least 1
> query, 2 if using lazy loading) and then add the
> Conversation to the
> Community (a second query to update the join table).
>
> Unfortunately, I've been unable to find any
> documentation or examples
> that deal with a large object graph but are unable
> to use lazy loading
> and proxies because of the EJB layer.  I'd be very
> grateful for any
> pointers to docs or examples that solve this
> problem.  I'm sure I'm
> going about it from the complete wrong direction
> which is why I'm
> running into this issue in the first place.
>
> --Chris
>
>
>
>
-------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld =
> Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>
>
>
>
>
**********************************************************************
> Any personal or sensitive information contained in
> this email and
> attachments must be handled in accordance with the
> Victorian Information
> Privacy Act 2000, the Health Records Act 2001 or the
> Privacy Act 1988
> (Commonwealth), as applicable.
>
> This email, including all attachments, is
> confidential.  If you are not the
> intended recipient, you must not disclose,
> distribute, copy or use the
> information contained in this email or attachments.
> Any confidentiality or
> privilege is not waived or lost because this email
> has been sent to you in
> error.  If you have received it in error, please let
> us know by reply
> email, delete it from your system and destroy any
> copies.
>
**********************************************************************
>
>
>
>
>
>
-------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld =
> Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com




**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to