Wednesday, August 10, 2011

J2EE Concurrency

A number of approaches are available for concurrency in J2EE applications, but each has its shortcomings:

  • Explicit allocation of threads is discouraged by the J2EE specifications since containers handle thread management. Having a thread pool ThreadPoolExecutor.
  • Using the Work Manager specification results in non-portable solutions that are limited to certain application servers, such as WebLogic and WebSphere, because it is not part of the J2EE specifications (including Java EE 5).
  • Encapsulating the work units in JMS queue messages that are then processed by Message Driven Beans (MDBs) in a concurrent fashion is appropriate for certain scenarios. However, this approach is relatively complex and resource-intensive for most applications.
  • Using inherent thread pool management of EJB timers. This approach is portable across application servers and does not require a messaging provider and resources such as queues and connection factories. Furthermore, since EJB timers are transactional and recoverable, this approach enables robust and reliable concurrency solutions

No comments:

Post a Comment