This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have another doubt. If a request is sent to a servlet and this request is sent in a new thread. The servlet in turn calls another Ejb. So will the call to the Ejb take place in the same thread or another thread will be started.
The answer is: perhaps, but probably not. You need to think "does it matter"? One of the reasons you use EJB containers is to delegate the threading behaviour to the container itself. If you are doing something that requires you use the same thread you are probably doing somthing wrong. Why do you need to use the same thread?
Joined: Feb 01, 2007
Thanks for the reply. It was actually an interview question and i answered by saying that the ejb container takes care of creating threads for Ejbs. Didn't know if i was right or wrong.