Re: Re: MySQL Database Locking - needed?

From: Date: Wed, 11 Jul 2001 17:36:01 +0000
Subject: Re: Re: MySQL Database Locking - needed?
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-10300@lists.php.net to get a copy of this message
Hi You don't need a text file. Just store a version number for each table row and increment on every change. Check to see if the version number has incremented means that the row has been updated. This is called optimistic locking. Regards, John "Raquel Rice" <raquel@yellowline.com> wrote in message news:3B4B95F4.D9C7B019@yellowline.com... > Tom Peck wrote: > > > > > >How about writing a text file that would be your "lock" file, rather > > >than depending upon MySQL to do it for you? > > > > > >-- > > >Raquel > > > > So what you mean is: > > > > If someone clicks on a car to edit, a txt file is written (maybe called the > > carID.txt). Then if someone else clicks on that car to edit it, it says > > that it is already being edited by someone else because the txt file > > exists? So what happens if that person who clicked first closes his > > browser before updating the car? How can that text file be automatically > > erased? > > > > I think I'll just assume that this wont be a problem, and if someone > > overwrites someone elses edit then too bad.. :-) > > > > Tom > > Why not check the date/time the file was created? If an arbitrary > amount of time has expired (2 minutes? 5 minutes?) then you create your > own lock file as if the first wasn't there? > > -- > Raquel > ============================================================ > He who has imagination without learning has wings and no feet. > --Anonymous

« previous php.db (#10300) next »