I
Itai
Feedback appreciated.
Problem definition:
Two distinct users are in the process of filling out a three step
wizard type registration form. The first page requires choosing a
login id. Assuming the two users choose the same textual login id, the
wizard must assign the name to the first one who submitted the
request. However, since an entry in the database is created only after
successfully completing all wizard steps, this name must only be
assigned temporarily.
Following is the proposed solution:
1. Define a "log object" which hold uncommitted loginid's and place it
in the Application State object
2. Define a loginid entry in the Session State object to hold the
string representation of a chosen loginid
3. When the user submits the first page of the registration wizard:
3.1 Application.Lock()
3.2 Check if the name has already been placed in the "log object"
3.3 (if not) perform a db query for that name to check if already
assigned to other user (this should be quick assuming the login id is
the primary key).
3.4 Update the name in the "log object"
3.5 Application.UnLock()
3.6 Update the name in the Session State loginid entry
3.7 Resume normal wizard flow
3.8 Application.Lock()
3.9 Delete the name from the "log object" (this would be at the last
wizard page)
3.10 Application.UnLock()
4. In the Session_End event delete the appropriate "log object" entry
(in case of a timeout) using the Session State loginid entry as the
lookup key.
Problem definition:
Two distinct users are in the process of filling out a three step
wizard type registration form. The first page requires choosing a
login id. Assuming the two users choose the same textual login id, the
wizard must assign the name to the first one who submitted the
request. However, since an entry in the database is created only after
successfully completing all wizard steps, this name must only be
assigned temporarily.
Following is the proposed solution:
1. Define a "log object" which hold uncommitted loginid's and place it
in the Application State object
2. Define a loginid entry in the Session State object to hold the
string representation of a chosen loginid
3. When the user submits the first page of the registration wizard:
3.1 Application.Lock()
3.2 Check if the name has already been placed in the "log object"
3.3 (if not) perform a db query for that name to check if already
assigned to other user (this should be quick assuming the login id is
the primary key).
3.4 Update the name in the "log object"
3.5 Application.UnLock()
3.6 Update the name in the Session State loginid entry
3.7 Resume normal wizard flow
3.8 Application.Lock()
3.9 Delete the name from the "log object" (this would be at the last
wizard page)
3.10 Application.UnLock()
4. In the Session_End event delete the appropriate "log object" entry
(in case of a timeout) using the Session State loginid entry as the
lookup key.