O'Reilly logo

Head First EJB by Bert Bates, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Session Bean Lifecycle: Being a Session Bean

image with no caption

Session beans are created and removed. If you’re lucky, you’re a stateless bean. Because the life of a stateful bean is tied to the whims of a heartless client. Stateful beans are created at the client’s insistence, and exist only to serve that one client. As a stateful bean, the best you can hope for is that the client crashes or forgets to call remove(); it might take the Container a while to figure out you’ve become useless. But ahhhh, the life of a stateless bean is fabulous! Pools, those little umbrella drinks, and no boredom since you get to meet so many different clients. Of course, even a stateless bean dies with an unchecked exception...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required