wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Singleton Versus Stateless Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Singleton Versus Stateless" Watch "EJB Singleton Versus Stateless" New topic

EJB Singleton Versus Stateless

Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486

Hello jRanchers

I would like to exchange some ideas about the EJB 3.1.
The question that bothers me is where we must use stateless session bean since we now have the new type singleton bean. In my head, I believe most stateless session bean can be replaced by singleton bean ...
Why keep a pool of stateless session bean since you could be processing all requests with just one singleton bean? I believe this is even a good thing in its scalability, in which you spend only 1 object instead of a pool.
Before EJB 3.1, EJB layers to DAO's and Service's were all defined as stateless in ejb because we did not have to use them as a singleton ... but now ... it is possible to believe that the stateless ejb type will end up falling in depreciation soon.
What is the opinion of you guys?
When using stateless over singleton?

Fernando Franzini - Java Blog
Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486

I really do not understand why my post removed to another forum since this relates to the decision related to part 2 of OCMJEA.
I agree. Here's the link: http://aspose.com/file-tools
subject: EJB Singleton Versus Stateless
Similar Threads
Stateless session beans
Stateless session beans and Transactions
EJB3 and the Singleton
The difference between EJB object and stateless session beans