This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Will the singleton use on EJBObject cause problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Will the singleton use on EJBObject cause problem?" Watch "Will the singleton use on EJBObject cause problem?" New topic
Author

Will the singleton use on EJBObject cause problem?

Allan Stone
Greenhorn

Joined: Oct 21, 2005
Posts: 24
For stateless session beans, beans are not tied to EJBObject until the client calls a business method. And the container manages the bean creation if needed.

Then, how about EJBObject, should an application create an EJBObject instance every time it needs to call a business method?

If two or more clients invoke business method on the same instance of EJBObject simultaneously, what will happen?


Practice make perfect.<br /> <br />SC-(JP/WCD/BCD/EA)
Vinay Raj
Ranch Hand

Joined: Jun 19, 2006
Posts: 81
It is definitely not recommended way of using session beans. Two or more clients invoke business method on the same instance of EJBObject simultaneously can be done via user developed multi-threaded program, which is a strict no-no in EJBs. The obvious problem areas would be transaction, security management.
 
GeeCON Prague 2014
 
subject: Will the singleton use on EJBObject cause problem?