<commit_before>[[EJB3]]
= EJB3 subsystem configuration guide

This page lists the options that are available for configuring the EJB
subsystem.

A complete example of the config is shown below, with a full explanation
of each

[source,xml,options="nowrap"]
----
<subsystem xmlns="urn:jboss:domain:ejb3:10.0">
  <session-bean>
    <stateless>
      <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
    </stateless>
    <stateful default-session-timeout="600000" default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
    <singleton default-access-timeout="5000"/>
  </session-bean>
  <mdb>
    <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
    <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
  </mdb>
  <entity-bean>
    <bean-instance-pool-ref pool-name="entity-strict-max-pool"/>
  </entity-bean>
  <pools>
    <bean-instance-pools>
      <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      <strict-max-pool name="entity-strict-max-pool" max-pool-size="100" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
  </bean-instance-pools>
  </pools>
  <caches>
    <simple-cache name="simple"/>
    <distributable-cache name="distributable" bean-management="default"/>
  </caches>
  <async thread-pool-name="default"/>
  <timer-service thread-pool-name="default" default-data-store="default-file-store">
    <data-stores>
      <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
    </data-stores>
  </timer-service>
  <remote connectors="remoting-connector" thread-pool-name="default">
    <profiles>
        <profile name="profile" exclude-local-receiver="false" local-receiver-pass-by-value="false">
          <remoting-ejb-receiver name="receiver" outbound-connection-ref="remote-ejb-connection"/>
          <remote-http-connection name="connection" uri="http://localhost:8180/wildfly-services"/>
          <static-ejb-discovery>
            <module uri="http://localhost:8180/wildfly-services" module-name="foo" app-name="bar" distinct-name="baz"/>
          </static-ejb-discovery>
        </profile>
    </profiles>
  </remote>
  <thread-pools>
    <thread-pool name="default">
      <max-threads count="10"/>
      <core-threads count="10"/>
      <keepalive-time time="60" unit="seconds"/>
    </thread-pool>
  </thread-pools>
  <iiop enable-by-default="false" use-qualified-name="false"/>
  <in-vm-remote-interface-invocation pass-by-value="false"/> <!-- Warning see notes below about possible issues -->
</subsystem>
----

[[session-bean]]
== <session-bean>

[[stateless]]
=== <stateless>

This element is used to configure the instance pool that is used by
default for stateless session beans. If it is not present stateless
session beans are not pooled, but are instead created on demand for
every invocation. The instance pool can be overridden on a per
deployment or per bean level using `jboss-ejb3.xml` or the
`org.jboss.ejb3.annotation.Pool` annotation. The instance pools
themselves are configured in the `<pools>` element.

[[stateful]]
=== <stateful>

This element is used to configure Stateful Session Beans.

* `default-session-timeout` This optional attribute specifies the default
amount of time in milliseconds a stateful session bean can remain idle
before it is eligible for removal by the container.
It can be overridden via `ejb-jar.xml` deployment descriptor or via
`javax.ejb.StatefulTimeout` annotation.

* `default-access-timeout` This attribute specifies the default time
concurrent invocations on the same bean instance will wait to acquire
the instance lock. It can be overridden via the deployment descriptor or
via the `javax.ejb.AccessTimeout` annotation.

* `cache-ref` This attribute is used to set the default cache for
beans which require a passivating cache. It can be overridden by `jboss-ejb3.xml`, or via
the `org.jboss.ejb3.annotation.Cache` annotation.

* `non-passivating-cache-ref` This attribute is used to set the default cache
for beans which require a non-passivating cache.

[[singleton]]
=== <singleton>

This element is used to configure Singleton Session Beans.

* `default-access-timeout` This attribute specifies the default time
concurrent invocations will wait to acquire the instance lock. It can be
overridden via the deployment descriptor or via the
`javax.ejb.AccessTimeout` annotation.

[[mdb]]
== <mdb>

[[resource-adaptor-ref]]
=== <resource-adaptor-ref>

This element sets the default resource adaptor for Message Driven Beans.

[[bean-instance-pool-ref]]
=== <bean-instance-pool-ref>

This element is used to configure the instance pool that is used by
default for Message Driven Beans. If it is not present they are not
pooled, but are instead created on demand for every invocation. The
instance pool can be overridden on a per deployment or per bean level
using `jboss-ejb3.xml` or the `org.jboss.ejb3.annotation.Pool`
annotation. The instance pools themselves are configured in the
`<pools>` element.

[[entity-bean]]
== <entity-bean>

This element is used to configure the behavior for EJB2 EntityBeans.

[[bean-instance-pool-ref-1]]
=== <bean-instance-pool-ref>

This element is used to configure the instance pool that is used by
default for Entity Beans. If it is not present they are not pooled, but
are instead created on demand for every invocation. The instance pool
can be overridden on a per deployment or per bean level using
`jboss-ejb3.xml` or the `org.jboss.ejb3.annotation.Pool` annotation. The
instance pools themselves are configured in the `<pools>` element.

[[pools]]
== <pools>

[[caches]]
== <caches>

This element is used to define named cache factories to support the persistence of SFSB session states.
Cache factories may be passivating (an in-memory cache with the ability to passivate to persistant store<commit_msg>[WFLY-16918] EJB: Add pools description to admin documentation<commit_after>[[EJB3]]
= EJB3 subsystem configuration guide

This page lists the options that are available for configuring the EJB
subsystem.

A complete example of the config is shown below, with a full explanation
of each

[source,xml,options="nowrap"]
----
<subsystem xmlns="urn:jboss:domain:ejb3:10.0">
  <session-bean>
    <stateless>
      <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
    </stateless>
    <stateful default-session-timeout="600000" default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
    <singleton default-access-timeout="5000"/>
  </session-bean>
  <mdb>
    <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
    <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
  </mdb>
  <entity-bean>
    <bean-instance-pool-ref pool-name="entity-strict-max-pool"/>
  </entity-bean>
    <pools>
    <bean-instance-pools>
      <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      <strict-max-pool name="entity-strict-max-pool" max-pool-size="100" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
    </bean-instance-pools>
  </pools>
  <caches>
    <simple-cache name="simple"/>
    <distributable-cache name="distributable" bean-management="default"/>
  </caches>
  <async thread-pool-name="default"/>
  <timer-service thread-pool-name="default" default-data-store="default-file-store">
    <data-stores>
      <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
    </data-stores>
  </timer-service>
  <remote connectors="remoting-connector" thread-pool-name="default">
    <profiles>
        <profile name="profile" exclude-local-receiver="false" local-receiver-pass-by-value="false">
          <remoting-ejb-receiver name="receiver" outbound-connection-ref="remote-ejb-connection"/>
          <remote-http-connection name="connection" uri="http://localhost:8180/wildfly-services"/>
          <static-ejb-discovery>
            <module uri="http://localhost:8180/wildfly-services" module-name="foo" app-name="bar" distinct-name="baz"/>
          </static-ejb-discovery>
        </profile>
    </profiles>
  </remote>
  <thread-pools>
    <thread-pool name="default">
      <max-threads count="10"/>
      <core-threads count="10"/>
      <keepalive-time time="60" unit="seconds"/>
    </thread-pool>
  </thread-pools>
  <iiop enable-by-default="false" use-qualified-name="false"/>
  <in-vm-remote-interface-invocation pass-by-value="false"/> <!-- Warning see notes below about possible issues -->
</subsystem>
----

[[session-bean]]
== <session-bean>

[[stateless]]
=== <stateless>

This element is used to configure the instance pool that is used by
default for stateless session beans. If it is not present stateless
session beans are not pooled, but are instead created on demand for
every invocation. The instance pool can be overridden on a per
deployment or per bean level using `jboss-ejb3.xml` or the
`org.jboss.ejb3.annotation.Pool` annotation. The instance pools
themselves are configured in the `<pools>` element.

[[stateful]]
=== <stateful>

This element is used to configure Stateful Session Beans.

* `default-session-timeout` This optional attribute specifies the default
amount of time in milliseconds a stateful session bean can remain idle
before it is eligible for removal by the container.
It can be overridden via `ejb-jar.xml` deployment descriptor or via
`javax.ejb.StatefulTimeout` annotation.

* `default-access-timeout` This attribute specifies the default time
concurrent invocations on the same bean instance will wait to acquire
the instance lock. It can be overridden via the deployment descriptor or
via the `javax.ejb.AccessTimeout` annotation.

* `cache-ref` This attribute is used to set the default cache for
beans which require a passivating cache. It can be overridden by `jboss-ejb3.xml`, or via
the `org.jboss.ejb3.annotation.Cache` annotation.

* `non-passivating-cache-ref` This attribute is used to set the default cache
for beans which require a non-passivating cache.

[[singleton]]
=== <singleton>

This element is used to configure Singleton Session Beans.

* `default-access-timeout` This attribute specifies the default time
concurrent invocations will wait to acquire the instance lock. It can be
overridden via the deployment descriptor or via the
`javax.ejb.AccessTimeout` annotation.

[[mdb]]
== <mdb>

[[resource-adaptor-ref]]
=== <resource-adaptor-ref>

This element sets the default resource adaptor for Message Driven Beans.

[[bean-instance-pool-ref]]
=== <bean-instance-pool-ref>

This element is used to configure the instance pool that is used by
default for Message Driven Beans. If it is not present they are not
pooled, but are instead created on demand for every invocation. The
instance pool can be overridden on a per deployment or per bean level
using `jboss-ejb3.xml` or the `org.jboss.ejb3.annotation.Pool`
annotation. The instance pools themselves are configured in the
`<pools>` element.

[[entity-bean]]
== <entity-bean>

This element is used to configure the behavior for EJB2 EntityBeans.

[[bean-instance-pool-ref-1]]
=== <bean-instance-pool-ref>

This element is used to configure the instance pool that is used by
default for Entity Beans. If it is not present they are not pooled, but
are instead created on demand for every invocation. The instance pool
can be overridden on a per deployment or per bean level using
`jboss-ejb3.xml` or the `org.jboss.ejb3.annotation.Pool` annotation. The
instance pools themselves are configured in the `<pools>` element.

[[pools]]
== <pools>

[[bean-instance-pools]]
=== <bean-instance-pools>

This element is used to configure pools used by stateless session, message driven beans and entity beans.

[[strict-max-pool]]
==== <strict-max-pool>

Each pool is configured using `strict-max-pool` element.

* `name` Name of the pool.
* `max-pool-size` Configured maximum number of bean instances that the pool can hold at a given point in time.
* `instance-acquisition-timeout` The maximum amount of time to wait for a bean instance to be available from the pool.
* `instance-acquisition-timeout-unit` The instance acquisition timeout unit

[[caches]]
== <caches>

This element is used to define named cache factories to support the persistence of SFSB session states.
Cache factories may be passivating (an in-memory cache with the ability to passivate to persistant store
{'fraction_non_alphanumeric': 0.11868745636490576, 'fraction_numerical': 0.008765805600806765, 'mean_word_length': 4.320676846884028, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 141, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6545813', 'n_tokens_mistral': 3972, 'n_tokens_neox': 3793, 'n_words': 1257}