226
Another approach to solving the same problem is to store client variables in a
back-end common state repository. This approach enables all Web servers
comprising the cluster to access variables in a common, shared back-end data store,
such as a database. However, you must be aware that this approach can potentially
impact your site's performance.
Web developers must think through the various user scenarios in which application
session and state are affected and engineer appropriate mechanisms for elegantly
handling such situations. The three most common ways to handle session data are:
Whatever mechanism your architects and engineers use, it's important that they
anticipate the scenarios in which maintaining an application's state is vital to a good
user experience. See
Database locking and concurrency issues
Dynamic Web applications, those that allow users to modify a database, must ensure
appropriate database concurrency handling. Database concurrency handling refers
to how an application manages multiple concurrent user requests when accessing
the same database records. If an application does not impose any database locking
mechanism on multiple requests to update the same record, data integrity can be
compromised in the database. In such a scenario, two users could make
simultaneous modifications to a record, but only the last change would take effect.
For example, consider a Human Resources Web application on a company intranet.
The HR Generalist adds two new employee records to the HR database by filling out a
Web form because two new employees have just been hired. The Generalist enters
most of the vital information into the records but doesn't yet have the new
employees' phone extensions or HMO selections, and therefore leaves those fields
blank. Later in the day, the HR Generalist's boss, the HR Director, obtains this
information from both new hires and decides to enter it in the database herself.
However, one of the new employees, after speaking with her husband, decides to
change her HMO selection from the basic selection to the PPO choice, which allows
greater flexibility in choosing physicians. The employee calls the HR Generalist to tell
him of the change, and the Generalist says he will take care of it immediately.
Unbeknownst to the HR Director, the HR Generalist adds the information into the
employee records at the same time that the HR Director is attempting to add the
outdated information.
Client-side options consisting of cookies, hidden fields, a get list, or URL
parameters
Server-side session variables
Note
Storing session data on the server requires that a simple identifier be stored on
the client, such as a cookie.
An open state repository consisting of either a common back-end database or
some other shared storage device
"Session-Aware Load Balancing" on page
Chapter 11 Scalability and Availability Overview
276.
Need help?
Do you have a question about the COLDFUSION 5-ADVANCED ADMINISTRATION and is the answer not in the manual?