Hi,
When using enterprise beans, it's best to maintain session state with stateful session beans in the EJB tier. For Web-only applications, maintain the state in the Web tier as session attributes (using HttpSession).
Reasons to prefer stateful session beans over other approaches to maintaining session state include:
Thread safety--Enterprise beans are thread-safe. By contrast, sophisticated thread-safe
servlets are difficult to write.
Lifecycle management--The EJB container manages the lifecycle of enterprise beans components, automatically creating new instances, and activating and passivating instances as necessary to optimize performance.
Client type neutrality--Enterprise beans can be accessed, either directly or through some sort of adapter, from multiple client types. This contrasts with HTTP session attributes, which are available only to HTTP clients.