[Java programming language only]

Example: Persisting an updated session attribute with the setAttribute() method

If you have configured an application server cluster to have HTTP session persistence, then you must call the setAttribute( ) method after modifying the attribute. Otherwise, the modified attribute does not get persisted to the remote server.

How to call the setAttribute ( ) method after modifying an attribute

The example code snippet show how to call the setAttribute() method after modifying an object. This example is applicable to HTTP session persistence that use IBM application servers.
Object A = session.getAttribute();
A = <Value>;    // modify A
session.setAttribute(A, Value);  // stores the modified attribute to a remote server.