> I
> don't like the idea of copying all that data into objects in memory to
later
> populate the page, but I also don't like the coupling of the cycling
through
> the ResultSet to the view page itself.

IMHO
 Even though it consumes more resources, I reckon it's cleaner to load the
objects from the db into memory then render them in the jsp.

The less the jsp knows abut the datasource/"where stuff came from"  the
better.

i.e.
jsp says : ooh look a collection of objects in the request(my preferred
method of giving stuff to jsp's)...I don't give a **** where it came from
I'll just go ahead and render it...

Some people might advocate a cool "lazy loading" DB object system but
*personally* I don't like my persistence layer accessing the DB unless I
give it the ability:connection (No I don't use EJB's or J2EE App server
transaction management).

I had a similar issue the other day.  User requests 000's of rows from the
DB to be displayed in Excel.  After the increasing the Java heap size to
something near useful(rather than the Tomcat standard of 16 MB or
something), the app did it's job nicely...Excel however fell onto the floor
in a quivering heap....mmm

Lesson? make sure your view media can handle what your application throws at
it.

Hope this helps

Jin
----- Original Message -----
From: "Will Stranathan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 04, 2002 9:19 PM
Subject: Large ResultSet's in MVC?


> I'm sure this issue has come up before, but I can't seem to find the right
> combination of search phrases to find solutions.
>
> I know the proper way to deal with database access in MVC is to decouple
> that access from the presentation - usually by populating view beans with
> the results of database queries.  Some folks even make reference to
> ResultSetUtils - which maps ResultSet data to collections of beans.
>
> But what if the amount of data returned is large?  I can't really give
some
> size off the top of my head, but say you returned a thousand rows to
> something the user would save in Excel or something?  Or for whatever
> reason, the client didn't have a problem viewing a large amount of rows?
I
> don't like the idea of copying all that data into objects in memory to
later
> populate the page, but I also don't like the coupling of the cycling
through
> the ResultSet to the view page itself.
>
> Is there some sort of an elegant compromise?  Or have folks who have dealt
> with this just decided to live with the problem of cycling through a
> resultset in a JSP page, then remembering to close everything in the page?
>
> Thanks,
> Will Stranathan
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to