O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

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

Stateless, Stateful, and Entity Beans

EJB allows for several types of beans: stateless, stateful, and entity. As you progress from stateless to entity, the beans offer more functionality, but at the cost of more required coding.

Stateless Beans

The easiest bean type, and the one you'll look at first, is a stateless session bean. Session beans are usually likened to verbs in English; they are used for actions, such as adding something to the database or computing a value.

Stateless session beans are throwaway objects. They are maintained in a pool on the EJB server. They keep no state between calls, and they operate strictly on the data passed in via the call.

Stateful Beans

Stateful session beans are allowed to maintain state between calls. By ...

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