File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Parallelism/ExecutorService in J2EE environment Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Parallelism/ExecutorService in J2EE environment" Watch "Parallelism/ExecutorService in J2EE environment" New topic
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Parallelism/ExecutorService in J2EE environment
 
Similar Threads
paging using xsl
running a fixed number of threads all the time
FixedThreadPool issue: more threads then expected seems to be working
Pvcs problem
Monitor Process on Remote Server