Acquiring the attribute file
Execute the following command to acquire a Session Bean attribute file:
- Execution format
cjgetappprop [server-name] [-nameserver provider-URL] -name J2EE application-name -type ejb -resname EJB-JAR-display-name/Stateful-Session-Bean-display-name -c path-of-the-Session-Bean-attribute-file
|
- Example of execution
cjgetappprop MyServer -name adder -type ejb -resname adder/MyAdder -c C:\home\MyAdder.xml
Setting the attributes
Execute the following command to apply the values of the Session Bean attribute file:
- Execution format
cjsetappprop [server-name] [-nameserver provider-URL] -name J2EE application-name -type ejb -resname EJB-JAR-display-name/Stateful-Session-Bean-display-name -c path-of-the-Session-Bean-attribute-file
|
- Example of execution
cjsetappprop MyServer -name adder -type ejb -resname adder/MyAdder -c C:\home\MyAdder.xml
The runtime properties of the Stateful Session Bean are classified into the following two types:
- Runtime attributes common to the Session Beans
- Attributes specific to the Stateful Session Beans
The respective settings are described below:
(a) Runtime attributes common to the Session Beans
The following table describes the property settings of runtime attributes (<runtime>) common to the Session Bean:
| Items |
Mandatory |
Corresponding tags |
| Look up name of the Enterprise Beans#1 |
Y |
<lookup-name> |
| Optional name of the Enterprise Bean name having a remote interface#1 |
O |
<optional-name> |
| Optional name of the Enterprise Bean name having a local interface#1 |
O |
<local-optional-name> |
| Maximum number of sessions#2 |
O |
<maximum-sessions> |
| Pass by reference settings#3 |
O |
<pass-by-reference> |
- Legend:
- Y: Mandatory
- O: Optional
- #1
- For referencing and changing the name registered in the JNDI namespace, see 9.13.2 Referencing and changing the Enterprise Bean name.
- #2
- The maximum number of sessions specified in the Stateful Session Bean is the maximum number of Stateful Session Beans that can be used from an EJB client application. If '0' is specified, the number of sessions (EJB objects) of the Stateful Session Beans that can be generated concurrently becomes infinite (the real maximum value is 2147483647).
- #3
- Pass by reference settings can be implemented in the usrconf.properties file also. If the settings are specified in either the properties or in the usrconf.properties file, the pass by reference settings become valid.
For details on the property settings, see 3.4.1 Contents of the Session Bean property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.
(b) Attributes specific to Stateful Session Beans
The following table describes the property settings of runtime attributes specific to the Stateful Session Bean (<runtime> - <stateful>):
| Items |
Mandatory |
Corresponding tags |
| Maximum number of active sessions |
Y |
<maximum-active-sessions> |
| Period for which the bean is passivated, before it is reactivated |
Y |
<inactivity-timeout> |
| Period for which the bean is passivated, before the session is deleted |
Y |
<removal-timeout> |
- Legend:
- Y: Mandatory
For details on the property settings, see 3.4.1 Contents of the Session Bean property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.
The property settings and operations are explained below:
- Maximum number of active sessions
- The generated Stateful Session Beans have the following two types of states:
- method-ready state
- passive state
- The Stateful Session Beans in the method-ready state are already executable when accessed from an EJB client application.
- The Stateful Session Bean in the passive state is activated and can be executed when it is in the method-ready state.
- In the maximum number of active sessions, specify the maximum number of Stateful Session Beans that can concurrently be in a method-ready state. This value is the maximum number of Stateful Session Beans for which execution can start immediately, when accessed from multiple EJB client applications. If the number of Stateful Session Beans that are generated is more than the number specified here, some of the Stateful Session Beans that are in method-ready state are passivated. Among the Stateful Session Beans in the method-ready state, the Beans that are in a transaction are not passivated. If '0' is specified in the maximum number of sessions or the maximum number of active sessions, the passivation function does not work (The state of the Stateful Session Bean does not change from method-ready state to passive state).
- Period for which the bean is passivated before it is reactivated (Default: 0 (minutes))
- Specify the timeout value in minutes. If the Stateful Session Bean that is in a passive state, does not get activated until the lapse of the specified time period, this Bean is deleted. If '0' is specified in the period for which the Stateful Session Bean remains in a passive state until the bean is reactivated, then a timeout does not occur. In the deletion of Stateful Session Bean instance, at maximum there may be a delay of the time specified in ejbserver.container.passivate.scan.interval, for the specified <inactivity-timeout> value. If you want to change this start up interval, specify the start up interval in the system property ejbserver.container.passivate.scan.interval of the usrconf.properties file in seconds. By default, 0 seconds are specified. An example of the specification of ejbserver.container.passivate.scan.interval is given below:
- When you want to start the delete function of a Stateful Session Bean that is in a passive state, at 10-minute intervals
ejbserver.container.passivate.scan.interval=600
|
- Period for which the bean is passivated before the session is deleted (Default: 0 (minutes))
- Specify the timeout value in minutes. If the Stateful Session Bean that is in a method-ready state, is not used even once during the period that is specified here, this Bean is deleted. Among the Stateful Session Beans in the method-ready state, the Beans in a transaction are not deleted.
- If '0' is specified in the period for which the Stateful Session Bean remains in a passive state until the session is deleted, then a timeout does not occur. In the deletion of Stateful Session Bean instance, at maximum there may be a delay of the time specified in ejbserver.container.remove.scan.interval, for the specified <removal-timeout> value. If you want to change this start up interval, specify the start up interval in ejbserver.container.passivate.scan.interval of usrconf.properties file in minutes. An interval of 5 minutes is assumed by default. An example of specification of ejbserver.container.remove.scan.interval is given below:
- When you want to start the delete function of a Stateful Session Bean that is in a method-ready state, at 10-minute intervals
ejbserver.container.remove.scan.interval=10
|
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.