Instance variables in a session with no state beans

I read this post and it does not answer my question. Standing bean session with instance variables I am reading the JEE5 tutorial and on this page it points to http://download.oracle.com/javaee/5/tutorial/doc/bnbly.html "However, clients can change the state of instance variables in a merged state without beans state, and this state is held until the next call to the unified idle bean "

I do not agree with that. Because I thought that saving β€œany” state through calls to another beans instance was something you needed for a session with beans state for.

Please help me understand this thanks in advance Rooban

+6
source share
1 answer

In EJB, the distinction between "stateful" and "stateless" means a dialog state , not just the state of a Java object (that is, any use of instance fields).

From Wikipedia :

In a session with bean state, instance variables represent the state of unique client-bean sessions. Client interaction with a bean is called an interactive state.

A classic example is a shopping cart for an e-commerce application. You must use SFSB to store the cart object, because it must maintain interactive state between requests.

On the other hand:

A session without a bean is an object that does not have a state associated with it, but can have an instance state. It does not allow simultaneous access to the bean. The contents of instance variables are not guaranteed for all method calls. All instances of a non-bean session must be considered identical by the client.

Related Questions

+4
source

Source: https://habr.com/ru/post/885777/


All Articles