Configure the global session persistence settings to balance your needs for performance, reliability, and high availability. You can override these settings for specific applications by changing the properties of the manager-properties, store-properties, and session-properties subelements of the session-manager element in the sun-web.xml file.
The configure-ha-persistence command is available only in the Enterprise Edition of the Sun Java System Application Server.
The authorized domain administration server administrative username.
The ––password option is deprecated. Use ––passwordfile instead.
This option replaces the –– password option. Using the ––password option on the command line or through the environment is deprecated. The ––passwordfile option specifies the name of a file containing the password entries in a specified format. The entry for the password must have the AS_ADMIN_ prefix followed by the password name in capital letters. For example, to specify the domain administration server password, use an entry with the following format: AS_ADMIN_PASSWORD=password, where password is the actual administrator password. Other passwords that can be specified include AS_ADMIN_MAPPEDPASSWORD, AS_ADMIN_USERPASSWORD, AS_ADMIN_MQPASSWORD, AS_ADMIN_ALIASPASSWORD, and so on.
The machine name where the domain administration server is running. The default value is localhost.
The port number of the domain administration server listening for administration requests. The default port number for Enterprise Edition is 4849.
If set to true, uses SSL/TLS to communicate with the domain administration server.
Indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-formatted data for consumption by a script. Default is false.
Setting to true will echo the command line statement on the standard output. Default is false.
If set to true (default), only the required password options are prompted.
Displays the help text for the command.
Set the persistence type to specify where session data is stored. The persistence types available are:
memory If session persistence for the application server instance is disabled, this is the default persistence type. The memory persistence type provides no session persistence in a clustered environment. The memory persistence type is intended for development environments and should not be used for production.
file This type provides no session persistence in a clustered environment. Use file persistence type to store session data in a file. If the instance becomes unavailable and restarts, it can recover the session information that was last written to the file. The file persistence type is meant for development environments and should not be used for production.
ha If session persistence for the application server instance is enabled, this is the default persistence type. This type allows you to store session data in the HADB. The ha persistence type enables failover of ses sion information between application server instances in a cluster. The session information for each application server instance in a clus ter is stored in the HADB. The session information is available to all other instances in the cluster. If an instance in a cluster becomes unavailable, another instance in the cluster can continue to serve the sessions that the now unavailable instance was serving.
Set the persistence frequency to define the frequency at which the session state is stored in the HADB. The persistence frequencies available are:
web-method The session is stored after every web request just before a response is sent back to the client. Use this frequency when you need very high availability of updated session states. This is the default.
time-based The session is stored at the time interval defined in the reapIntervalSeconds property. A better throughput is achieved because the session is stored after a configurable time interval instead of after every web request.
Set the persistence scope to determine how much of the session is stored. The persistence scopes available are:
modified-session The entire session is stored only if it has been modified since the last time it was stored.
session The entire session is stored every time session information is saved to the HADB. This is the default.
modified-attribute Only the modified attributes of the session are stored. Using this mode can improve the throughput and response time significantly for applications in which only a small portion of the session state is modified for any given request.
If you use the modified-attribute persistence scope, your application should follow these guidelines:
Call setAttribute() every time you modify the session state.
Make sure there are no cross-references between attributes. The object graph under each distinct attribute key is serialized and stored separately. If there are any object cross references between the objects under each separate key, they are not serialized and deserialized correctly.
Ideally, the session state should be stored in multiple attributes, or at least in a read-only attribute and a modifiable attribute.
Specify the JNDI name of the JDBC resource for the HADB. The default is jdbc/hastore.
Specify other session persistence properties.
asadmin> configure-ha-persistence --user admin --passwordfile secret.txt --type ha --frequency web-method --scope modified-session --store jdbc/hastore cluster1