Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Thread Pooling Design Issue

Thread Pooling Design Issue

2003-11-18       - By Uthiresh Narayanan

 Back
Reply:     1     2     3  

Hi everybody,

       I have a business scenario, where there are multiple database
transactions
to be performed.  Each transaction is a very heavy duty process and takes
almost 30-45 mins approx. Each of the process request is intiated by the
user and are added in a table. They have to be performed, not necessarily
one at a time. But since each process consumes a lot of DB resources, I cant
have a *LOT* of these processes running at one time. The end of the process
is signalled when a flag is updated in that specific request entry in the
table.

I am planning to implement this as a thread pooling design where one thread
from the pool will service each request (ie. make a JDBC call and run the
stored procedure for the transaction). After servicing it will return to the
pool and then service a new request. I can limit the number of concurrently
running transactions by knowing the number of threads runnning and so queue
up other requests in the DB table. I am interested in knowing other
techniques to decide to queue u these requests.
Now these transactions are very data intensive and it might be possible that
the threads get struck in them for a long time.

One problem I forsee in this is if a thread get struck up in the database
process and never comes out (I cant keep a JDBC timeout coz I dont know how
much time each process might take!) so the thread becomes unusable and
moreover the request is unserviced. When I run this program on my appserver,
after some time I get the StuckThreadMaxTime warning in the thread dump and
the appserver hangs up.(Each request is a row in the database and new
requests are identified by a  simple N flag , a 'P' fl;ag for processing and
after servicing they are made Y). Now this row will be stuck up in 'P' state
forever.. I want to reset this flag to N so that it can be picked up by some
other thread and start processing again.

Moreover if threads keep getting stuck the pool will eventually be empty. I
know that I can dynamically increase the size of the pool, but till when?
The number of user requests will be quite high.

What might be other issues with this design paradigm ? and thread pooling in
general.
I know this is not a robust design technique, so would be glad to hear ur
suggestions.

I am running Weblogic 7.0 and Oracle 8i.

TIA.
reagrds,
uthiresh

===========================================================================
To unsubscribe, send email to listserv@(protected) and include in the body
of the message "signoff J2EE-INTEREST".  For general help, send email to
listserv@(protected) and include in the body of the message "help".



©2008 junlu.com - Jax Systems, LLC, U.S.A.