See my earlier post on this thread. You can use custom finders with
_extreme_ ease in Orion. I gave an example for Oracle (since Oracle does not
_have_ the sql LIMIT statement). For other databases, you could use a LIMIT
statement in your custom finder.

Regards,

the elephantwalker
www.elephantwalker.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of prasanth sb
Sent: Friday, April 05, 2002 7:20 AM
To: Orion-Interest
Subject: RE: CMP 2.0 vs BMP - Which performes better?


Hi Jeff and other dear friends,
                         I had this doubt in my mind very earlier.
When we load very large amount of data from the database, how it can be
handled? If we use result sets and iterate, this is going to take a long
time? How can we limit the number of records that is present
in the memory at a time?

thanks,
Prasanth.





>From: "Jeff Schnitzer" <[EMAIL PROTECTED]>
>Reply-To: Orion-Interest <[EMAIL PROTECTED]>
>To: Orion-Interest <[EMAIL PROTECTED]>
>Subject: RE: CMP 2.0  vs BMP -  Which performes better?
>Date: Thu, 4 Apr 2002 16:22:17 -0800
>
> > From: Curt Smith [mailto:[EMAIL PROTECTED]]
> >
> > > There are several constraints to BMP beans which make them almost
>always
> > > perform slower than CMP beans.  In particular, the inability to bulk
> > > load beans from finder methods is a nearly fatal defect.
> >
> > I'd like to know more of the details?
> >
> > How does the container deal with the following finder in CMP
> > differently than BMP?
> >
> > Collection remoteRefs = home.findSalaryGreaterThan ( "50,000");
>
>Lets assume this produces 1000 results which you then iterate through.
>
>With BMP beans, this will require 1001 database queries.  First the
>finder, then 1000 selects to load each bean.
>
>With CMP, it's actually rather ambiguous what will happen.  Last time I
>checked, Orion will load all the beans into an ArrayList.  Yes, lots of
>memory consumed, but a *lot* better than 1001 database hits.  Admittedly
>a bigger problem with orders of magnitude more objects, but even with
>BMP you're going to choke if the finder query returns a billion rows of
>primary key data.
>
>Some containers (not Orion, I don't think) allow you to specify that
>finders should lazy-load beans.  But this brings you back to BMP
>performance.  Some containers allow you to define "field groups" to
>minimize the amount of data brought back (especially useful if you store
>blobs), but not Orion.
>
>Personally, I don't understand why containers don't implement
>Collections backed by the ResultSet directly.  98% of the time, the
>client just creates an iterator and walks the results.  If the client
>does something that the ResultSet can't support, build the full
>Collection.
>
>Jeff Schnitzer
>[EMAIL PROTECTED]
>


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx




Reply via email to