Re: MySQL Locking Question

From: Date: Sat, 06 Oct 2001 02:09:43 +0000
Subject: Re: MySQL Locking Question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-70173@lists.php.net to get a copy of this message
So once a user logs into a MySQL Server via PHP, if they don't logout, they stay logged in forever??????? Rasmus Lerdorf <rasmus@php.net> wrote in message news:Pine.LNX.4.33.0110051845150.1317-100000@rasmus.php.net... > > A. Browser Closed Before Finishing Edit: > > From what I have read Get_Lock locks are automatically released > > when connections terminate. I'm new to this so am unsure if MySQL will > > terminate the connection when the browser is closed. If not does MySQL > > disconnect users after a certain time? And is this a configurable option? > > No, a mysql connection is server side and has absolutely nothing to do > with what the user does with their browser client-side. You can't make a > mysql connection close when someone closes their browser. And no, MySQL > does not disconnect users after a certain time. > > > B. User goes to lunch before hitting Submit > > I was thinking of putting a timout feature in the browser so that > > after say 5 minutes a prompt asking the user that has the record locked if > > he is still working or wants to cancel. This popup would have 20 seconds or > > so before cancel was automatically selected and the lock is released. > > > > C. User types in www.something.com and leaves the editing page in limbo: > > I have no idea what to do in this situation. If MySQL can be > > configured to boot a user after so may minutes of activity then that is the > > solution. As with possibility A I am unsure. > > > > Sound Feasable? > > No, I see all sorts of problems with this. Personally I would put the > check at the commit stage. Maintain a record modification counter. Right > before committing the changes check to see if that counter has changed, if > it has warn the user that the record was changed out from underneath > him/her and put the edit form back up with the changes. > > -Rasmus >

« previous php.general (#70173) next »