Well, lazy loading of a field is only useful if we have a huge text
or binary field and we don't want to serialize it to and from
the database each time we load the object.

However, in Hibernate there are other workarounds for this
situation (query projection, Lightweight Class, etc.)

Henri Tremblay wrote:

I think I can't agree more with everything you said.
And I didn't know the thing about the database reading the complete row anyway.
It makes vanish the last argument I can think of for component lazy loading.


From: "Joshua Davis" <[EMAIL PROTECTED]>
To: "'Henri Tremblay'" <[EMAIL PROTECTED]>,"'hibernate-devel'" <[EMAIL PROTECTED]>
Subject: RE: [Hibernate] Lazy components
Date: Wed, 25 Feb 2004 05:27:37 -0500


> -----Original Message-----
> From: Henri Tremblay [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 23, 2004 5:26 PM
> To: Joshua Davis; 'Gavin King'; 'hibernate-devel'
> Subject: Re: [Hibernate] Lazy components

[snip]

> That said, the benefit of having lazy loading on components
> will be to allow to load only a part of a db table row. The
> fields mapped in the component won't be selected by
> hibernate.

The database might read the row anyway, so it may or may not make any
difference from the database server's perspective. Speaking from experience
with applications that have many, complex domain objects my own preference
would be to use separate tables and one-to-one mappings.


> From my point of view, selecting a little less
> fields in the same table will rarely provide a big
> performance gain. Especially if you then lazy load them
> later. If there's a real gain, you should have put them in
> another table anyway I think.

Yes, two queries are much more likely to take longer than one. The
application must be analyzed carefully to see which components are
infrequently referenced in order to add the overhead. Again, in my
experience most applications change enough over their lifetime that lazy
loading may become inappropriate (or appropriate) as the application
evolves. Given that, I'd say that choosing the one-to-one mapping is the
best because configuring the lazy loading behavior is a simple configuration
parameter.






-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



-- Gavin King JBoss Group +61 410534454 http://hibernate.org



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to