| Author |
Parallelism/ExecutorService in J2EE environment
|
Debopam Poddar
Ranch Hand
Joined: Jun 21, 2005
Posts: 49
|
|
I have to develop one process that will process fast. Below is my requirement and my thoughts
This process executes 10 different queries. To have the performance better I will create ThreadPool using assign independent queries as task and attach with ExecutorService. Then submit the task. I will do it within a stateless session bean. Please let me know whether this approach is correct or not. The machine I am running is dual processor quad core machine with 2G Ram.
I would also like to do/start the processing immediately after results from query are available (doesn't want to wait till all the results are available). Please let me know how to achieve this.
|
 |
Chris Hurst
Ranch Hand
Joined: Oct 26, 2003
Posts: 370
|
|
Look up
work manager
and see if your container supports it yet.
Your not supposed to create your own threads in J2EE (you can off course) , the idea is you submit tasks to a work manager that is integrated in the container, makes thread management a lot easier going forward.
I guess if you are doing something really complex and need the advantages of say Java 7 fork / join doing the threading yourself may be preferable but your losing some of the advantages of J2EE.
|
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
|
 |
 |
|
|
subject: Parallelism/ExecutorService in J2EE environment
|
|
|