简体   繁体   English

EJB Bean钝化

[英]EJB Bean passivation

I have read that when ejbPassivate() is called Stateful Session Beans are usually evicted but Entity Beans and Stateless Beans are pooled which means they are not appilicable for passivation. 我已经读过,当ejbPassivate()被称为有状态会话Bean通常被驱逐但实体Bean无状态Bean被合并,这意味着它们不适用于钝化。

In another article I have read that activation and passivation is applicable only for Stateful Session Beans and Entity Beans which is a contrast to the claim that Entity Beans and Stateless Beans are pooled. 在另一篇文章中,我读到激活和钝化仅适用于有状态会话Bean实体Bean ,这与实体Bean无状态Bean合并的声明形成对比。

For what beans does the passivation apply and what does really happen when they do? 钝化适用于什么豆类?当它们发生时会发生什么?

Passivation and Activation only apply to EJBs that have state, namely stateful session beans and entity beans. 钝化和激活仅适用于具有状态的EJB,即有状态会话bean和实体bean。

Passivation is the process by which any state a given bean has is moved into storage. 钝化是将给定bean所具有的任何状态移入存储的过程。

Activation is the process by which any state that a given bean previously had is loaded from storage. 激活是从存储加载给定bean以前具有的任何状态的过程。

This mechanism is needed because the EJB contain creates a pool of each bean type but gives the illusion that there are an infinate number of each bean, loading and storing them using the ejbActive and ejbPassivate methods respectively as needed. 这种机制是必需的,因为EJB包含创建每个bean类型的池,但给出了每个bean有无限数量的假象,分别根据需要使用ejbActive和ejbPassivate方法加载和存储它们。

The full life-cycle of each bean type is described here: 这里描述了每种bean类型的完整生命周期:

Stateless Session Bean 无状态会话Bean

Stateful Session Bean 有状态会话Bean

Entity Bean 实体Bean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM