• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parallelism/ExecutorService in J2EE environment

 
Ranch Hand
Posts: 51
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 443
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Your buns are mine! But you can have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic