Stateless session bean with instance variables
我正在阅读JEE5教程,并在此页面上说明
http://download.oracle.com/javaee/5/tutorial/doc/bnbly.html
“
但是,客户端可以更改池化无状态bean中的实例变量的状态,并且此状态将保留到池化无状态bean的下一次调用
“
我不同意这一点.因为我认为在不同的bean实例的调用中保持“任何”状态是你需要’有状态’的会话bean.
请帮我理解这个
提前thx
Rooban
解决方法
In a stateful session bean,the instance variables represent the state of unique client-bean sessions. The interaction of the client with bean is called as conversational state.
典型的例子是电子商务应用程序的购物车.您使用SFSB来存储“cart”对象,因为它需要在请求之间保持对话状态.
A stateless session bean is an object that does not have an associated conversational state,but may have instance state. It does not allow concurrent access to the bean. The contents of instance variables are not guaranteed to be preserved across method calls. All instances of a stateless session bean should be considered identical by the client.
相关问题
> Stateless and Stateful Enterprise Java Beans
> Stateful EJBs in web application?
> Correct usage of Stateful Beans with Servlets
> Static vs Instance members in Stateless EJBs
> Why use stateful session beans?