Re: MySQL Locking Question

From: Date: Sat, 06 Oct 2001 00:59:14 +0000
Subject: Re: MySQL Locking Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70167@lists.php.net to get a copy of this message
> 1. Jack opens record A to change an entry. > 2. Jill opens record A to change an entry. > 3. Jack finishes his changes and saves the data. > 4. Jill finishes her changes and saves the data. Well, if you only update the fields that changed then who cares? The fields that Jill changes are going to overwrites Jack's changes anyway. Locking the record and having Jack finish before Jill can start isn't going to change the end result which would be that Jill's changes are going to overwrite Jack's. > Jill just over wrote whatever Jack did. The only method I could think of to > prevent this was to have the client check to see if the record was allready > being edited by someone. If it is then they have to wait. Is there > another way to do this? What are atomic updates?? ie. update foo set field=field+1 where id=47 An increment of the field column guaranteed to happen in one operation such that two such increments happening concurrently will not interfere with each other. -Rasmus

« previous php.general (#70167) next »