File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes stateful session EJB 3 question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "stateful session EJB 3 question" Watch "stateful session EJB 3 question" New topic

stateful session EJB 3 question

Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Hello ranchers,
are stateful session EJBs still a heavy-weigth object that one should avoid in designs?
Please correct me if I'm wrong, but it seems to me that stateful session beans are way lighter in EJB 3.0 than 2.X.
Thanks in advance...

When the compiler's not happy, ain't nobody happy...
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Any thoughts anyone?
Horst Naujoks

Joined: Jul 12, 2002
Posts: 12
I think the advice to avoid stateful session beans does't come from their cognition as "heavy weigth" objects. The true problem with sfsb is that they introduce higher demands on application servers in a clustered environment (transfering "state" from on server to another for the sake of failover, loadbalancing, etc.).
In my opinion, even with EJB3 it's still essential to carefully think about their usage.
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
sounds reasonable...
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183

The question whether to include stateful session beans in our design, was raised many times in this forum; many people are very determined to be on one side or the other.

Horst and many other fellows are reluctant to use stateful session beans, because of practical implementation issues that different application servers had and have with these beans.

However, as an architect you need to factor into your decision, the benefits of a particular technology and weigh it against the current/past implementation problems.

Personally, I think that Sun would be delighted to see stateful session beans in your design, whenever it's appropriate, and it's definitely appropriate in certain places in our solution.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Actually, I'll surely use 'em in my assignment. I was only very keen to know if the discussion was still valid for the lighter EJB3.
Thanks for your comments.
I agree. Here's the link:
subject: stateful session EJB 3 question
jQuery in Action, 3rd edition