You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Donie Kelly <do...@tecnomen.ie> on 2002/09/06 17:27:20 UTC

Running a long transaction with tomcat but responding to user qui ckly

Hi all

I want to run a long transaction which lasts about 2 seconds with tomcat but
after I have gathered the information from the request I want to return 200
OK to user and close the connection to the browser. However, the thread
should continue to process the request and when finished it should return to
the thread pool tomcat has.

I want to set the tomcat pool up as follows in server.xml
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="80" minProcessors="5" maxProcessors="5"
               enableLookups="true" redirectPort="443" acceptCount="100"
debug="0" connectionTimeout="60000"/>
So basically, I want only 5 threads running at any time and under load
conditions it should cause a backlog of 100 with 5 threads doing the
processing. It is important though that the threads return quickly to the
user.

Thanks for any solutions
Donie


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Running a long transaction with tomcat but responding to user qui ckly

Posted by Ronald Klop <ro...@klop.yi.org>.
Try something like this in your servlet.

void doGet(request, response) {
	...
	// Get request info
	...
	out = response.getOutputStream();
	out.write("<html><body>Hello, everything is ok.</body></html>");
	out.close();
	...
	// Do the transaction here
	...
}

Greetings,

Ronald.

Donie Kelly wrote:
> Hi all
> 
> I want to run a long transaction which lasts about 2 seconds with tomcat but
> after I have gathered the information from the request I want to return 200
> OK to user and close the connection to the browser. However, the thread
> should continue to process the request and when finished it should return to
> the thread pool tomcat has.
> 
> I want to set the tomcat pool up as follows in server.xml
> <Connector className="org.apache.catalina.connector.http.HttpConnector"
> port="80" minProcessors="5" maxProcessors="5"
>                enableLookups="true" redirectPort="443" acceptCount="100"
> debug="0" connectionTimeout="60000"/>
> So basically, I want only 5 threads running at any time and under load
> conditions it should cause a backlog of 100 with 5 threads doing the
> processing. It is important though that the threads return quickly to the
> user.
> 
> Thanks for any solutions
> Donie
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

-- 
  Ronald Klop
  Amsterdam, The Netherlands


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>