uCosminexus Application Server, Expansion Guide

[Contents][Index][Back][Next]

7.3.2 Processing when executing a request

This section describes creating, updating, and deleting a global session when executing a request and inheriting a global session.

If processing is executed in a Web application, the processing for global session information occurs as an extension to the processing. The following table describes examples of processing executed in Web applications, processing executed for global session information at the time of execution of the request corresponding to the example, and reference locations:

Table 7-14 Examples of processing in Web applications and mapping of processing executed for global session information

No. Example of processing executed in a Web application Processing executed for global session information Reference location
1 Login Creating global session information (1)
2 Executing work (page transition/update) Updating global session information (2)
3 Logout Deleting global session information (3)
4 Logout due to timeout Deleting global session information due to expiry of validity 7.3.3
5 Executing work on another J2EE server that inherited the global session
(when a failure occurs on a J2EE server)
Inheriting session information that uses global session information (4)

For the results of processing when a failure occurs during global session information operations, see 7.3.4 Operations performed when a failure occurs during global session information operation.

Organization of this subsection
(1) Creating global session information
(2) Updating global session information
(3) Deleting global session information
(4) Inheriting session information that uses global session information

(1) Creating global session information

When a new HTTP session is created on a J2EE server, global session information is created on the EADs server.

The following figure shows the flow of processing executed when creating global session information:

Figure 7-4 Creating global session information (EADs session failover functionality)

[Figure]

  1. The HTTP session receives the necessary request and obtains a session. In the Web application, newly acquire the HttpSession object by using the getSession() method or the getSession(true) method of the javax.servlet.http.HttpServletRequest interface.
    An HttpSession object is created in the following cases also:
    • If you use Form authentication
    • If you specify true in the session attribute of the page directive in JSP
    • If you omit specification of the session attribute of the page directive in JSP
  2. A session ID is generated and an HTTP session is created. Global session information is created as an extension to HTTP session creation processing.
    Newly created global session information includes session ID and use status. NEW, which indicates that HTTP session attribute information is not stored, is set for the usage status immediately after creating new information.
  3. Created global session information is stored in the session information cache on the EADs server.

(2) Updating global session information

When a session is updated during execution of a Web application, the HTTP session is updated on the J2EE server. At the same time, global session information on the EADs server is also updated.

The following figure shows the flow of processing executed when updating global session information:

Figure 7-5 Updating global session information (EADs session failover functionality)

[Figure]

  1. The request in which the HTTP session exists is received and the session is updated in the Web application.
  2. Along with updating of the session in the Web application, the HTTP session and global session are updated.
  3. Global session information in the session information cache on the EADs server is updated.

(3) Deleting global session information

If you implement the invalidate() method of the javax.servlet.http.HttpSession interface in session deletion processing in a Web application and explicitly delete an HTTP session, global session information on the EADs server is deleted as an extension to that processing.

The following figure shows the flow of processing executed when deleting global session information:

Figure 7-6 Deleting global session information (EADs session failover functionality)

[Figure]

  1. The HTTP session is disabled in the Web application.
  2. HTTP session and global session information are deleted.
  3. User functions provided by the EADs session failover functionality are executed on the EADs server.
  4. The contents of the J2EE server identifier, owned by the HTTP session, are checked on the EADs sever. If the contents match with the identifier of the J2EE server in operation, the global session information is deleted.

(4) Inheriting session information that uses global session information

If an HTTP session associated with the received request does not exist on the J2EE server, the HTTP session is created again by using the global session information on the EADs server. This enables obtaining an HTTP session equivalent to the contents at the point of time when the previous request processing ended, with the Web application, and work can be continued.

The following figure shows the flow of processing executed when inheriting session information that uses global session information:

Figure 7-7 Inheriting session information that uses global session information (EADs session failover functionality)

[Figure]

  1. If an HTTP session associated with the received request does not exist on the J2EE server, the HTTP session is created again on the J2EE server by using the global session information stored in the session information cache on the EADs server.#
  2. User functions provided by the EADs session failover functionality (obtaining global session information and changing J2EE server identifier owned by the HTTP session) are executed on the EADs server.
  3. Global session information is obtained and the J2EE server identifier owned by the HTTP session is changed on the EADs server.
  4. The HTTP session is updated in the Web application.
  5. The global session information is updated after execution of the Web application.
  6. Global session information that is stored in the session information cache on the EADs server is updated.

# However, if the use status is NEW (attribute information of the HTTP session is not stored) or SERIALIZE_FAIL (HTTP session serialization has failed in previous request), the global session information is not inherited.

If inheriting of the global session information is successful, the KDJE34424-I message is output to the message log. If global session information could not be inherited because the global session information corresponding to the session ID, which is received from the client, does not exist in the session information cache on the EADs server, the KDJE34426-W message is output to the message log.