Updating client gui with session beans ejb

Since session beans don't typically represent persistent shared data, and stateful session beans can only be accessed by a single client at a time, user transaction boundaries may not be important to such a bean.If, however, the session bean is managing database data for the user, it may want to know about the beginning and ending of user transactions, so that it can cache data at the start and commit its database updates at the end.

updating client gui with session beans ejb-30updating client gui with session beans ejb-16

The session bean does not maintain state across method calls.

If a client makes a series of remote method calls and/or transactions with the stateless bean, the bean is in the same state at the start of each method call or transaction. Stateless session beans of the same type can be considered identical to each other, and can be pooled and reused by multiple clients.

The container uses this information to determine how to handle pooling of the session beans and whether to passivate the bean or not, among other things.

Since stateless beans can be used by any client, the container pools stateless beans and doles them out to clients as needed.

If new stateless beans are needed, the container creates them, and when they aren't needed (e.g., the rate of client requests decreases), they are simply destroyed.