tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damjan Majstorovic" <damj...@hotmail.com>
Subject creating threads in tomcat
Date Tue, 10 Feb 2004 11:01:17 GMT
Hi all;

I realize this is a 'complex' (for me at least) question, but maybe someone 
can give me
their opinion on it.

I am using Tomcat 5 for my webapp which allows insertion of messages (and 
much more).
I also need to have an independent 'engine' that will look into DB and 
'handle' newly inserted
messages. This engine will, depending on the type of message, do a specific 
task. This
will require arround 7 new threads that I will control (hopefully). Among 
other things I will
need to read information from database in these new threads.

I feel like I have 3 choices:

1. Implement my engine in Tomcat JVM.
2. Implement it in a JVM outside Tomcat and communicate with the webapp only 
thru DB.
   (so almost have 2 independent apps that use the same DB)
3. Implement it in a JVM outside Tomcat and communicate with Tomcat JVM thru 
RMI.

I like 1. because all would be in one place, and I would use DB connection 
pooling provided
by Tomcat.
I like 2. because I understand it is bad to open new threads in Tomcat.
I like 3 because I avoid having threads in Tomcat, but can get to DB thru
classes that are already in my Tomcat JVM via RMI. I do not like it because 
it is more complex.

**********************
So I have one question:
**********************
1. How bad (what performance hit, and other negative aspects should I 
expect) is it
    to open new threads in Tomcat, and arround 7 of them.

and I wonder if someone can point me or suggest to me to a solution, 
article, discussion
or anything about this little problem that I have.

Sincerely and thankfully
Damjan

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message