You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Praveen Potineni <po...@hotmail.com> on 2001/11/08 21:22:06 UTC

Server crashes...

Hi all,
I have a query which gets 1 million records. When i try to query from a bean and access it from JSP(i'm using Tomcat 4.0 on win 2000), the application takes forever and finally crashes on me. It says running out of virtual memory.
I have a question:
What is the physical location of the resultset. When i do a query where is the result set coming and storing all the values.What is the physical location of the data that is being retrieved.

How can i make the data access quick.

Thanks
Praveen

Re: Server crashes...

Posted by Mika Goeckel <mi...@stepstone.de>.
Hey Praveen,

that depends on the jdbc class you're using. Oracle for instance allows you
to specify how many records you want to take in one go into your resultset.
Afterwards you can reload further records. But anyway, what requirement do
you have that you need all the records, sounds odd :-)

Cheers, Mika

----- Original Message -----
From: "Praveen Potineni" <po...@hotmail.com>
To: "JSP_INTEREST" <JS...@JAVA.SUN.COM>;
<to...@jakarta.apache.org>
Sent: Thursday, November 08, 2001 9:22 PM
Subject: Server crashes...


Hi all,
I have a query which gets 1 million records. When i try to query from a bean
and access it from JSP(i'm using Tomcat 4.0 on win 2000), the application
takes forever and finally crashes on me. It says running out of virtual
memory.
I have a question:
What is the physical location of the resultset. When i do a query where is
the result set coming and storing all the values.What is the physical
location of the data that is being retrieved.

How can i make the data access quick.

Thanks
Praveen



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Server crashes...

Posted by Praveen Potineni <po...@hotmail.com>.
Hi all,
Thanks for the suggestion you have given on this topic. Though my intention
is not to make the user surf thru all the million records, but i was trying
to test such a big load. Our application is in the initial stages of
development and i was trying to see if tomcat can handle such a big load.
I'm using Sybase ASA 6.0 and jConnect sybase driver for JDBC.
Yeah ..I would definately narrow my query to retrieve few records to
display. I was trying to do what my boss had asked me to do.

Thanks again.
Praveen

----- Original Message -----
From: "Richard Troy" <rt...@ScienceTools.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Cc: "JSP_INTEREST" <JS...@JAVA.SUN.COM>
Sent: Thursday, November 08, 2001 3:53 PM
Subject: Re: Server crashes...


>
> Praveen,
>
> You have a query returning a million rows and you want to make the data
> access quick. Hmmm... I have to question your strategy. HTML and the world
> wide web are oriented toward serving humans directly and while I'm not
> saying it's impossible, I find it hard to believe that there's a
> legitimate reason for a human being to try and look at a million result
> rows on a web page. If you are serving a human being, reduce the result
> set to something reasonable. You didn't say your query uses SQL but
> presuming that it is, use the WHERE clause. A reasonable return value for
> a real human being is probably less than one hundred, or thereabouts. If
> your applicaiton is not serving a human being, then use a direct, non-html
> based application approach - traditional client-server style.
>
> Hope this helps,
> RT
> Richard Troy, Chief Scientist
> Science Tools Corporation
> rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/
>
> On Thu, 8 Nov 2001, Praveen Potineni wrote:

> > Hi all,
> > I have a query which gets 1 million records. When i try to query from a
bean and access it from JSP(i'm using Tomcat 4.0 on win 2000), the
application takes forever and finally crashes on me. It says running out of
virtual memory.
> > I have a question:
> > What is the physical location of the resultset. When i do a query where
is the result set coming and storing all the values.What is the physical
location of the data that is being retrieved.
> >
> > How can i make the data access quick.
> >
> > Thanks
> > Praveen

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Server crashes...

Posted by Denis Balazuc <de...@trader.com>.
Hi all

True enough, 1 million record is not human, but there's situations
(well...there is probably...) when this can happen...
I'm thinking about gathering statistics for instance...(altough this can be
achieved on the database server itself)

To answer the question, and as stated before, it all depends on the JDBC
driver you are using.
Many of them support server-side cursors as ResultSets (you see your cursors
as a ResultSet and fetching data is done as if you were using a cursor - so
data are coming in your java app when you actually request them and go
through the result set).

So the place to look is definitely the JDBC API and your driver's
documentation.....

I think there's an example in the JDC tutorials (on the JTable samples) that
shows you how to fill a JTable using a result set when you have loads of
data to display.
(the table gets a range of results from the ResultSet according to what it
is supposed to display) - unfortunately I can't remember the exact link
(try http://java.sun.com/tutorials)

But definitely, you cannot afford getting 1 million records at once and
process them afterward... ;-)

> --
> Richard Troy, Chief Scientist
> Science Tools Corporation
> rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/
>
> On Thu, 8 Nov 2001, Praveen Potineni wrote:
>
> > Date: Thu, 8 Nov 2001 15:22:06 -0500
> > From: Praveen Potineni <po...@hotmail.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: JSP_INTEREST <JS...@JAVA.SUN.COM>,
tomcat-user@jakarta.apache.org
> > Subject: Server crashes...
> >
> > Hi all,
> > I have a query which gets 1 million records. When i try to query from a
bean and access it from JSP(i'm using Tomcat 4.0 on win 2000), the
application takes forever and finally crashes on me. It says running out of
virtual memory.
> > I have a question:
> > What is the physical location of the resultset. When i do a query where
is the result set coming and storing all the values.What is the physical
location of the data that is being retrieved.
> >
> > How can i make the data access quick.
> >
> > Thanks
> > Praveen
> >



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Server crashes...

Posted by Richard Troy <rt...@ScienceTools.com>.
Praveen,

You have a query returning a million rows and you want to make the data
access quick. Hmmm... I have to question your strategy. HTML and the world
wide web are oriented toward serving humans directly and while I'm not
saying it's impossible, I find it hard to believe that there's a
legitimate reason for a human being to try and look at a million result
rows on a web page. If you are serving a human being, reduce the result
set to something reasonable. You didn't say your query uses SQL but
presuming that it is, use the WHERE clause. A reasonable return value for
a real human being is probably less than one hundred, or thereabouts. If
your applicaiton is not serving a human being, then use a direct, non-html
based application approach - traditional client-server style.

Hope this helps,
RT


-- 
Richard Troy, Chief Scientist
Science Tools Corporation
rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/

On Thu, 8 Nov 2001, Praveen Potineni wrote:

> Date: Thu, 8 Nov 2001 15:22:06 -0500
> From: Praveen Potineni <po...@hotmail.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: JSP_INTEREST <JS...@JAVA.SUN.COM>, tomcat-user@jakarta.apache.org
> Subject: Server crashes...
>
> Hi all,
> I have a query which gets 1 million records. When i try to query from a bean and access it from JSP(i'm using Tomcat 4.0 on win 2000), the application takes forever and finally crashes on me. It says running out of virtual memory.
> I have a question:
> What is the physical location of the resultset. When i do a query where is the result set coming and storing all the values.What is the physical location of the data that is being retrieved.
>
> How can i make the data access quick.
>
> Thanks
> Praveen
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>