in reply to Executing a Script to Completion
Two people trying to add the same surname simultaneously is already handled because add_surname.cgi first checks if an entry already exists for the surname in question.This makes two people adding the same surname less likely, but not impossible. Imagine your code is like this:
1. Check if surname exists 2. Add surnameand you have two clients, Alice and Bob, both adding the same surname. If things happen to be ordered like this:
Alice: Check if surname exists (it doesn't) Bob: Check if surname exists (it doesn't) Alice: Add surname Bob: Add surnameyou'll have the same problem. One solution is to enforce only a single surname in the database, with UNIQUE constraints on columns.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Executing a Script to Completion
by exussum0 (Vicar) on Jan 02, 2004 at 12:35 UTC |