Sub-sessions provide the ability to manage multiple or concurrent sessions under the same session between the client and server. This enables applications to isolate certain session data from other instances. For example, a session context holds the data and services that are exclusive to a workstation. Two bank tellers are sharing the same workstation. Each teller has their own sub-session. The sub-sessions are isolated from each other but they all have access to the information in the session context and higher in the context hierarchy. This allows the tellers to share the workstation. The first teller's environment (sub-session and context) remains untouched by anything in the second teller's environment. However, both environments can access information at the parent context level such as the workstation ID and password.
The following process describes how this example could be implemented. In this case, one teller's login has created a session in the application logic layer and associated the workstation context (wks1) associated with the session. The process also added a session entry into the application session table to establish a link between the session and the context instance.
To support switching between applications, the login process establishes a sub-session for each teller. The following diagram shows what happens when user1 logs in from a Java(TM) client.
In the scenario, the following happens: