简体   繁体   English

ejb bean实例池jboss EAP 6.1

[英]ejb bean instance pool jboss EAP 6.1

In our project we are migrating from JBoss5 to Jboss EAP 6.1. 在我们的项目中,我们将从JBoss5迁移到Jboss EAP 6.1。 When I was going through the configuration to be used in Jboss EAP 6.1, I stumbled upon below: 当我在Jboss EAP 6.1中使用配置时,我偶然发现:

<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="1" instance-acquisitiontimeout-unit="MILLISECONDS"/>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="1" instance-acquisitiontimeout-unit="MILLISECONDS"/>
</bean-instance-pools>
</pools>

I am not clear about the max-pool-size argument.Is this limit 20 instances per Stateless EJB bean deployed on JBoss or pool will go only up to 20 instances irrespective of the no of stateless EJB beans. 我不清楚max-pool-size参数。这个限制在JBoss或池上部署的每个无状态EJB bean的20个实例最多只能有20个实例,而不管无状态EJB bean的数量。

I don't agree with eis. 我不同意eis。 Here is code of Wildfly 8.2.1 StatelessSessionComponent.java 这是Wildfly 8.2.1 StatelessSessionComponent.java的代码

public StatelessSessionComponent(final StatelessSessionComponentCreateService slsbComponentCreateService) {
    super(slsbComponentCreateService);

    StatelessObjectFactory<StatelessSessionComponentInstance> factory = new StatelessObjectFactory<StatelessSessionComponentInstance>() {
        @Override
        public StatelessSessionComponentInstance create() {
            return (StatelessSessionComponentInstance) createInstance();
        }

        @Override
        public void destroy(StatelessSessionComponentInstance obj) {
            obj.destroy();
        }
    };
    final PoolConfig poolConfig = slsbComponentCreateService.getPoolConfig();
    if (poolConfig == null) {
        ROOT_LOGGER.debug("Pooling is disabled for Stateless EJB " + slsbComponentCreateService.getComponentName());
        this.pool = null;
        this.poolName = null;
    } else {
        ROOT_LOGGER.debug("Using pool config " + poolConfig + " to create pool for Stateless EJB " + slsbComponentCreateService.getComponentName());
        this.pool = poolConfig.createPool(factory);
        this.poolName = poolConfig.getPoolName();
    }

    this.timeoutMethod = slsbComponentCreateService.getTimeoutMethod();
    this.weakAffinity = slsbComponentCreateService.getWeakAffinity();
}

As I see pool is non-static field and is created for every type of Component(ejb class). 我认为pool是非静态字段,并且是为每种类型的Component(ejb类)创建的。

Red Hat documentation says 红帽文档

the maximum size of the bean pool. bean池的最大大小。

Also, if you go to admin panel of EAP and go to Profile -> Container -> EJB3 -> Bean Pools -> "Need Help?" 另外,如果你去EAP的管理面板并转到Profile - > Container - > EJB3 - > Bean Pools - >“需要帮助?” it says 它说

Max Pool Size: The maximum number of bean instances that the pool can hold at a given point in time 最大池大小:池在给定时间点可以容纳的最大Bean实例数

I would interpret that to mean that pool will go only up to 20 instances. 我认为这意味着池最多只能有20个实例。


Edit: in retrospect, answer by Sergey Kosarev saying it is per instance seems convincing enough that you should probably believe that instead. 编辑:回想起来, 谢尔盖Kosarev回答说,每个实例似乎足够令人信服,你可能应该相信。

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

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