O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

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

Client's View

Yesterday, you saw how to use JNDI to obtain a reference to a Session bean home and how to obtain a Session bean by calling the appropriate create() method. Now that you have a full understanding of how Session beans work, there are a few other points that are worth appreciating.

First, if your client has a reference to a stateless Session bean, although it should call remove() when it is finished with the EJB, this method call doesn't actually do particularly much. In particular, it won't release any bean resources itself, as shown clearly by the state chart diagrams in Figure 5.3. What this will do is allow the EJB container to remove the EJBObject proxy for the bean.

Conversely, calling create() for a stateless Session bean doesn't ...

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