Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateless Session bean / Simple java bean ?

 
santhosh kolathur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
------------------
San..
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic