# Session Beans

A session bean is a type of enterprise bean. It is created by a client and usually exists only for the duration of a single client-server session.

Session beans are useful for describing interactions between other beans (taskflow) and for implementing particular tasks. They do not represent data in the database, but they can access data, so we can use session beans to read, update, and insert data in a business process. Session beans access data that spans concepts, is not shared, and is usually read-only. Session beans contain business logic, and entities model persistent data. There are three types of session beans: stateless, stateful and singleton.

- Stateless session beans

  A stateless session bean is pooled by the container to handle multiple requests from multiple clients and does not maintain any conversational state.

- Stateful session beans

  A stateful session bean acts on behalf of a single client and maintains client-specific session information (called conversational state) across multiple method calls and transactions. It exists for the duration of a single client/server session.

- Singleton session beans

  A Singleton session bean is a session bean component that is instantiated once per application. In cases where the container is distributed over many virtual machines, each application will have one bean instance of the Singleton for each JVM.

Parent topic: Creating EJB Session Beans