Solved

Concurrency, Multithreaded support in EJB

Posted on 2011-09-06
3
350 Views
Last Modified: 2012-05-12
I would like to know differences, similarities, advantages, disadvantages of Concurrency, Multithreaded support in EJBs. How, where, why we use it. I was not clear on this concept. Thanks in advance
0
Comment
Question by:gudii9
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
a_b earned 500 total points
ID: 36493305
"Why is thread creation and management disallowed?

The EJB specification assigns to the EJB container the responsibility for managing threads. Allowing enterprise bean instances to create and manage threads would interfere with the container's ability to control its components' lifecycle. Thread management is not a business function, it is an implementation detail, and is typically complicated and platform-specific. Letting the container manage threads relieves the enterprise bean developer of dealing with threading issues. Multithreaded applications are still possible, but control of multithreading is located in the container, not in the enterprise bean."

Ref - http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html

When you use EJBs, the thread management is left to the container that you use.
0
 
LVL 7

Author Comment

by:gudii9
ID: 36589630
If i want some multi threading within my application not system-related functionality can i implement that using EJB. please advise
0
 
LVL 20

Expert Comment

by:a_b
ID: 36907854
Nope. You cannot. AS per the guidelines you should allow the container to instantiate the threads.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now