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

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateless Session bean / Simple java bean ?" Watch "Stateless Session bean / Simple java bean ?" New topic

Stateless Session bean / Simple java bean ?

santhosh kolathur

Joined: May 21, 2001
Posts: 3
Hi all,
The application I build have a few complex transactions involved which I'm planning to do using a stateless session bean. I'm using weblogic. I have a very short period of time and so (also new to EJB) decided not to go for entity beans considering 'not so good' experiences (mainly performance wise) of my colleagues. Now, is it really advantageous to use a stateless session bean instead of a normal bean ? What are the advantages I get if I use a stateless session bean over normal beans for database transactions ? It would be great if somebody could give me a reply fast (a lil detailed if possible).

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019

Your number one advantage is the ability to spread functionality over multiple hosts. A regular JavaBean is confined to its containing VM, an EJB can be in any VM, including one on a remote host. This can be a significant advantage for large workloads where you'd be running the function on multiple (clustered) hosts.
For less ambitious projects, EJBs still have advantages such as managed transactions and concurrency controls.
On the other hand, while regular JavaBeans don't get the industrial-strength infrastructure of EJBs, they don't have the overhead. And they're slightly easier to use in JSP's, where they're supported by the useBean directive.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link: http://aspose.com/file-tools
subject: Stateless Session bean / Simple java bean ?