List:General Discussion« Previous MessageNext Message »
From:Fred Read Date:May 12 1999 12:28pm
Subject:Re: Exclusive lock, MySQL/Perl HTTPD
View as plain text  
Orlando Andico wrote:
> 
> You could use a cookie. Only one browser can have the cookie. 
> Add a button to the HTML form "release cookie" The cookie can 
> be implemented with HTML::Embperl in the %udat hash. Only the 
> browser with the cookie can do updates.
> 
> Your Perl backend checks for presence of the cookie before 
> allowing updates. You probably also need a one-row table in 
> MySQL which stores the current owner of the cookie. If there 
> is nothing in that table, the browsers have a little race 
> condition to grab the cookie (don't know how you'll implement 
> that).

The main drawback with your idea [and table locking schemes] 
is the classic "Get cookie before going to lunch" problem. 
Also known as the "Get cookie and die" problem this can very 
easily result in frustrated users being locked out of your 
systems for extended periods.

The conditional update approach is far superior in every way 
and, because it relies on nothing more complex than the values
originally read from the table, is easy tom implement and does 
not suffer from any of these problems.

Hope this helps...
-- 

If it ain't opinionated, it ain't Rich Teer.
Thread
Table not updated when client disconnects from server...Pavel Nikiforov6 May
  • Table not updated when client disconnects from server...Jani Tolonen11 May
  • Table not updated when client disconnects from server...Michael Widenius11 May
    • Exclusive lock, MySQL/Perl HTTPDMailing Lists11 May
      • Re: Exclusive lock, MySQL/Perl HTTPDOrlando Andico11 May
        • Re: Exclusive lock, MySQL/Perl HTTPDFred Read12 May
      • Exclusive lock, MySQL/Perl HTTPDMichael Widenius11 May
        • Re: Exclusive lock, MySQL/Perl HTTPDMailing Lists11 May
          • Re: Exclusive lock, MySQL/Perl HTTPDRichard McLean12 May
          • Re: Exclusive lock, MySQL/Perl HTTPDRenaud Bruyeron12 May
        • Re: Exclusive lock, MySQL/Perl HTTPDFred Read12 May