aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes why call a local stateless bean? 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 "why call a local stateless bean?" Watch "why call a local stateless bean?" New topic
Author

why call a local stateless bean?

Damodar Mukherjee
Ranch Hand

Joined: Mar 20, 2007
Posts: 135
I want to know why call a local stateless bean instead of plain function call from the bean itself?

Is there any reason besides scalability?

Thanks


SCJP 1.5, SCWCD 1.4, Next... SCBCD5
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

Scalability is big. Session beans also provide transaction management especially if they interact with a database.

The rule of thumb is that if a database or other persistence storage is involved, use a session bean since it gives you transactional control. If you're calling a static-like method for performing some mathematical calculation then you'd want to avoid the session bean and just a regular method call.

What it really comes down to is this: Is the method providing a service or a utility function?
[ August 19, 2008: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
Damodar Mukherjee
Ranch Hand

Joined: Mar 20, 2007
Posts: 135
Thank You... I agree with you, but what if I know my application will always stay in a single container? In this situation is using EJB session bean is worth?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

Originally posted by Damodar Mukherjee:
what if I know my application will always stay in a single container?


Then I'd say you are a lucky man. If you are the only programmer than you shouldn't be using EJBs in the first place. EJBs are really only if you have a medium size company with many programmers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why call a local stateless bean?