Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)
E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go To Table Of Contents
Contents
Go To Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

<session-deployment>

The <session-deployment> section provides additional deployment information for a session bean deployed within this JAR file.

The <session-deployment> section contains the following structure:

<session-deployment pool-cache-timeout=... call-timeout=... copy-by-value=...
      location=... max-instances=... min-instances=... max-tx-retries=...
      tx-retry-wait=... name=... persistence-filename=... replication=...
      timeout=... idletime=... memory-threshold=... max-instances-threshold=...
      resource-check-interval=... passivate-count=... wrapper=...
      local-wrapper=... interceptor-type= ...
  <ior-security-config>
    <transport-config>
      <integrity></integrity>
      <confidentiality></confidentiality>
      <establish-trust-in-target></establish-trust-in-target>
      <establish-trust-in-client></establish-trust-in-client>
    </transport-config>
    <as-context>
      <auth-method></auth-method>
      <realm></realm>
      <required></required>
    </as-context>
    <sas-context>
      <caller-propagation></caller-propagation>
    </sas-context>
  </ior-security-config>
  <env-entry-mapping name=...> </env-entry-mapping
  <ejb-ref-mapping location=... name=... remote=... jndi-properties=... />
  <resource-ref-mapping location=... name=... >
    <lookup-context location=...>
       <context-attribute name=... value=... />
    </lookup-context>
  </resource-ref-mapping>
  <resource-env-ref-mapping location=... name=... />
  <message-destination-ref-mapping location=... name=... />
</session-deployment>

Note:

Alternatively, in an EJB 3.0 application, you can use the OC4J-proprietary annotations @StatelessDeployment and @StatefulDeployment. You can use the orion-ejb-jar.xml file <session-deployment> configuration to override @StatelessDeployment and @StatefulDeployment configuration. For more information, see "Configuring OC4J-Proprietary Deployment Options on an EJB 3.0 Session Bean".

For information on each of these elements and sub-elements, see the following:

Examples

For session bean examples, which include <session-deployment>, @StatefulDeployment, or @StatelessDeployment configuration (where relevant), see the following:

<session-deployment> Attributes

Table A-1 lists the attributes for the <session-deployment> element, their @StatelessDeployment and @StatefulDeployment annotation attribute equivalents (where appropriate), and indicates which are applicable to stateless session beans only, stateful session beans only, or both.

Table A-1 Attributes for the <session-deployment> Element

Attribute @StatelessDeployment Equivalent @StatefulDeployment Equivalent Stateless Stateful Description

call-timeout

callTimeout

callTimeout

Supported
Supported

This parameter specifies the maximum time to wait for any resource to make a business/life cycle method invocation. This is not a timeout for how long a business method invocation can take.

If the timeout is reached, a TimedOutException is thrown. This excludes database connections.

The default value is 90000 milliseconds. Set to 0 if you want the timeout to be forever. See the EJB section in the Oracle Application Server Performance Guide for more information.

copy-by-value

copyByValue

copyByValue

Supported
Supported

Whether or not to copy (clone) all the incoming and outgoing parameters in EJB calls. Set to false if you are certain that your application does not assume copy-by-value semantics for a speed-up. The default value is true.

idletime


idletime

Unsupported


Supported

You can set an idle timeout for each bean. When this timeout expires, passivation occurs. Set this attribute to the appropriate number of seconds. Default: 300 seconds. (5 minutes). To disable, specify any negative number.

interceptor-type

interceptorType

interceptorType

Supported
Supported

The attribute indicates how OC4J handles interceptor class life cycle. You can set the interceptor type to bean (stateful class) or singleton (stateless class).

When set to bean, OC4J creates a separate interceptor class instance for each session bean instance that you associate with that interceptor class. This is in accordance with the EJB 3.0 specification. In this case, the interceptor class must be stateful.

When set to singleton, OC4J creates a single interceptor class instance that all session bean instances share. In this case, the interceptor class must be stateless.

For more information, see "Singleton Interceptors".

local-location

localLocation

localLocation

Supported
Supported

The local JNDI name, to which this enterprise bean will be bound.

local-wrapper



Supported
Supported

Name of the OC4J local home wrapper class for this bean. This is an internal server value and should not be edited.

location

location

location

Supported
Supported

The JNDI-name to which this bean will be bound.

max-instances

maxInstances

maxInstances

Supported
Supported

The number of bean instances allowed in memory: either instantiated or pooled. When this value is reached, OC4J attempts to passivate beans using the least recently used (LRU) algorithm. To allow an infinite number of bean instances, the max-instances attribute can be set to zero. Default is 0, which means infinite. This applies to both stateless and stateful session beans.

To disable instance pooling, set max-instances to any negative number. This will create a new instance at the start of the EJB call and release it at the end of the call.

For more information, see the following:

max-instances-threshold


maxInstancesThreshold

Unsupported


Supported

Percentage of max-instances number of beans that can be in memory before passivation occurs.

Specify an integer that is translated as a percentage. If you define that the max-instances is 100 and the max-instances-threshold is 90%, then when the active bean instances is greater than or equal to 90, passivation of beans occurs. Default: 90%.

To disable, specify any negative number.

max-tx-retries

maxTransactionRetries

maxTransactionRetries

Supported
Supported

This parameter specifies the number of times to retry a transaction that was rolled back due to system-level failures. The default is 0.

For a stateful session bean, if a RuntimeException, Error, or RemoteException is thrown, the OC4J does not do a retry.

Generally, Oracle recommend that you add retries only where errors are seen that could be resolved through retries. For example, if you are using serializable isolation and you want to retry the transaction automatically if there is a conflict, you might want to use retries. However, if the bean wants to be notified when there is a conflict, then in this case, you should leave max-tx-retries=0.

See the EJB section in the Oracle Application Server Performance Guide for more information.

memory-threshold


memoryThreshold

Unsupported


Supported

This attribute defines a threshold for how much used JVM memory is allowed before passivation should occur. Specify an integer that is translated as a percentage. When reached, beans are passivated, even if their idle timeout has not expired. Default: 80%.

To disable, specify any negative number.

min-instances

minInstances


Supported
Unsupported

The number of minimum bean implementation instances to be kept instantiated or pooled. The default is 0. This setting is valid for stateless session beans only.

name



Supported
Supported

The name of the bean, which matches the name of a bean in the assembly section of the EJB deployment descriptor (ejb-jar.xml).

passivate-count


passivateCount

Unsupported


Supported

This attribute is an integer that defines the number of beans to be passivated if any of the resource thresholds have been reached. Passivation of beans is performed using the least recently used algorithm. Default: one-third of the max-instances attribute. You can disable this attribute by setting the count to zero or a negative number.

persistence-filename


persistenceFileName

Unsupported
Supported

Path to the file where sessions are stored across restarts.

pool-cache-timeout

poolCacheTimeout


Supported
Unsupported

The pool-cache-timeout applies to stateless session enterprise beans. This parameter specifies how long to keep stateless sessions cached in the pool.

For stateless session beans, if you specify a pool-cache-timeout, then at every pool-cache-timeout interval all beans of the corresponding bean type in the pool are removed. If the value specified is zero or negative, then the pool-cache-timeout is disabled and beans are not removed from the pool.

The default value is 60 (seconds)

replication


replicationType

Unsupported


Supported

Configuration of the state replication for stateful session beans. Values can be inherited (default) onShutdown, onRequestEnd, or none. See "State Replication" for more information.

resource-check-interval


resourceCheckInterval

Unsupported


Supported

The container checks all resources at this time interval. At this time, if any of the thresholds have been reached, passivation occurs. Default: 180 sec. (3 min.).

To disable, specify any negative number.

timeout


timeout

Unsupported


Supported

The maximum number of seconds that a stateful session bean may be inactive before being subject to pool clean-up. If the value is zero or negative, then all timeouts are disabled.

Every 30 seconds the pool clean up logic is invoked. Within the pool clean up logic, only the sessions that timed out, by passing the timeout value, are deleted.

Adjust the timeout based on your applications use of stateful session beans. For example, if stateful session beans are not removed explicitly by your application, and the application creates many stateful session beans, then you may want to lower the timeout value.

If your application requires that a stateful session bean be available for longer than 1800 seconds (equal to 30 minutes), then adjust the timeout value accordingly.

The default value is 1800 seconds.

transaction-timeout

transactionTimeout

transactionTimeout

Supported
Supported

The maximum number of seconds that OC4J will wait for a transaction started by this stateless or stateful session bean to commit or rollback. If the value is zero or negative, the timeout is disabled.

tx-retry-wait

transactionRetryWait

transactionRetryWait

Supported
Supported

This parameter specifies the time to wait in seconds between retrying the transaction. The default value is 60 seconds.

wrapper



Supported
Supported

Name of the OC4J wrapper class for this bean. This is an internal server value and should not be edited.


<ior-security-config>

The <ior-security-config> element is an interoperability element, which is discussed fully in the Interoperability chapter in the Oracle Containers for J2EE Services Guide.

<env-entry-mapping>

The <env-entry-mapping> element maps environment variables to JNDI names and is discussed in "Configuring an Environment Reference to an Environment Variable".

<ejb-ref-mapping>

The <ejb-ref-mapping> element maps any EJB references to JNDI names and is discussed in "EJB Environment References".

<resource-ref-mapping>

The <resource-ref-mapping> element maps any EJB references to JNDI names and is discussed in "Resource Manager Connection Factory Environment References".

<resource-env-ref-mapping>

The <resource-env-ref-mapping> element is used to map an administered object for a resource. For example, to use JMS, the bean must obtain both a JMS factory object and a destination object. These objects are retrieved at the same time from JNDI. The <resource-ref> element declares the JMS factory and the <resource-env-ref> element is used to declare the destination. Thus, the <resource-env-ref-mapping> element maps the destination object. See "Resource Manager Connection Factory Environment References" for more information.

<message-destination-ref-mapping>

The <message-destination-ref-mapping> element is only used if you are using JMS 1.1. Use this element to map the message-destination-ref-name in the client deployment descriptor to another location that is available in the OC4J environment. It provides means of linking message consumers and producers to one or more common logical destinations. For more information, see "Configuring an Environment Reference to a JMS Destination Resource Manager Connection Factory (JMS 1.1)".