glassfish中EJB Container的pool和cache的区别

本文探讨了池化Bean(pooled bean)与缓存Bean(cached bean)之间的区别。池化Bean彼此等价且不可区分,而缓存Bean则包含会话状态,并与主键相关联。此外,实体Bean会在激活时从池中移除并加入缓存,在钝化时从缓存中移除并返回到池中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The difference between a pooled bean and a cached bean is that pooled beans are all equivalent and indistinguishable from one another. Cached beans, on the contrary, contain conversational state in the case of stateful session beans, and are associated with a primary key in the case of entity beans. Entity beans are removed from the pool and added to the cache on ejbActivate() and removed from the cache and added to the pool on ejbPassivate(). ejbActivate() is called by the container when a needed entity bean is not in the cache. ejbPassivate() is called by the container when the cache grows beyond its configured limits. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值