What is the difference between bean staleful and staless?

0

What is the difference between a staleful and staless EJB? The categories for the sessionBeans, but what would be the concrete difference?

    
asked by DanielRoa 24.08.2017 в 17:53
source

1 answer

1

A stateless or stateless EJB is an EJB that does not save any information in its instance, therefore a request to an EJB of this type will only use the data that is passed as parameter and the data that in the calculation will be obtained from different data sources, but it will never save information in variables in memory for later reference, because when the function of the stateless EJB is invoked again, the Application Server will return a different instance of EJB, not giving meaning to save variables in memory since they will be lost. Perfect for transactional operations that are resolved within the same request.

A Stateful EJB is a state-of-the-art ejb, that is, you can keep data in memory for later reference, perfect for a shopping cart, although you have to use them carefully because maintaining a stateful memory directly affects the memory

Anything was attentive

    
answered by 24.08.2017 в 18:13