You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Fisher <mj...@press.uchicago.edu> on 2001/10/12 00:52:07 UTC

Can you assign low priority to a JSP?

I have a JSP which generates a huge report, output as HTML. It's a total
resource hog. With thread-pooling enabled, I am able to run at most two
instances of this JSP. At that point, no other request gets a response from the
server (Apache 1.3.20; Tomcat 3.2.3) until at least one of the reports finishes.

Is there any way to assign a low priority to the report JSP, so that it will
temporarily release resources as higher-priority requests come in? The data
entry JSPs are of much higher priority....

I assume the problem is available threads. Is there any way to check how many
threads are being used at any given time?

The report does one large query, then loops through each row in the result set,
and executes four subqueries for each row. Could this be hogging all the
available threads? Any way to make the subqueries reuse the same threads on each
iteration?

Many questions, and many thanks for any advice you can provide. At this point,
I'm very discouraged about Tomcat in general.

One small bit of good news -- enabling thread pooling, and trashing some pages
which did XML processing, has eliminated the out of memory errors I'd been
seeing.

Yours,

 - Matt
. . . . . . . . . . . . . . .
Matthew J. Fisher
Applications Programmer
University of Chicago Press
1427 E. 60th Street
Chicago, IL 60637-2954
Tel 773-834-5386


Re: Can you assign low priority to a JSP?

Posted by Janek Bogucki <ja...@yahoo.co.uk>.
If you aren't acquiring a lock on some resource which
would prevent the data entry JSPs from completing
perhaps you could put the thread to sleep between
rows.

Just a thought.

Janek Bogucki.

 --- Matt Fisher <mj...@press.uchicago.edu> wrote: > I
have a JSP which generates a huge report, output
> as HTML. It's a total
> resource hog. With thread-pooling enabled, I am able
> to run at most two
> instances of this JSP. At that point, no other
> request gets a response from the
> server (Apache 1.3.20; Tomcat 3.2.3) until at least
> one of the reports finishes.
> 
> Is there any way to assign a low priority to the
> report JSP, so that it will
> temporarily release resources as higher-priority
> requests come in? The data
> entry JSPs are of much higher priority....
> 
> I assume the problem is available threads. Is there
> any way to check how many
> threads are being used at any given time?
> 
> The report does one large query, then loops through
> each row in the result set,
> and executes four subqueries for each row. Could
> this be hogging all the
> available threads? Any way to make the subqueries
> reuse the same threads on each
> iteration?
> 
> Many questions, and many thanks for any advice you
> can provide. At this point,
> I'm very discouraged about Tomcat in general.
> 
> One small bit of good news -- enabling thread
> pooling, and trashing some pages
> which did XML processing, has eliminated the out of
> memory errors I'd been
> seeing.
> 
> Yours,
> 
>  - Matt
> . . . . . . . . . . . . . . .
> Matthew J. Fisher
> Applications Programmer
> University of Chicago Press
> 1427 E. 60th Street
> Chicago, IL 60637-2954
> Tel 773-834-5386
>  

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

JNDI / JDBC ClassCastException

Posted by Marc SCHNEIDER <ms...@sfwan.com>.
Hi,

I'm trying to connect to a mysql database using JNDI, but I get the
following error :

		java.lang.ClassCastException: tyrex.jdbc.xa.EnabledDataSource

Environnment : Tomcat 4.0 / linux RedHat 7.1 / MySql 3.23

Here is my Java code :

	Context initCtx = new InitialContext();
	Context envCtx = (Context) initCtx.lookup("java:comp/env");
	DataSource ds = (DataSource) envCtx.lookup("jdbc/test");

Here is the server.xml configuration

	<Resource name="jdbc/test" auth="CONTAINER" type="javax.sql.DataSource"/>
	<ResourceParams name="jdbc/test">
            <parameter><name>user</name><value>sa</value></parameter>
            <parameter><name>password</name><value></value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.gjt.mm.mysql.Driver</value></parameter>
            <parameter><name>driverName</name>

<value>jdbc:mysql://192.168.0.3:3306/testjouve</value></parameter>
	</ResourceParams>

When I use the "classic" method ie with
'Class.forName("org.gjt.mm.mysql.Driver").newInstance();' it works fine !

Any ideas ?

Thanks in advance,
Marc SCHNEIDER.