RE: DB Access, Sessions and Blocking Access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bret

Can you figure out how many minutes the average userwould take for an update/edit function? You could then write a CRON script to reset those accounts after some predetermined expiry time is reached.

Another option is to timestamp when the user requests the record and when it gets updated...if the update timestamp is before the request timestamp and the requestor id doesn't match the updator id, you know you haven't had the record checked in yet. You can then decide if there was an appropriate delay before issuing out the record to another user for their edit...

Bastien


From: Bret Walker <bret-walker@xxxxxxxxxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  DB Access, Sessions and Blocking Access
Date: Wed, 17 Aug 2005 17:19:38 -0500

Hello-

I'm developing a web-based system whereby users can edit documents and
then e-mail the documents to selected recipients.

The "documents" are comprised of the data from several MySQL fields.

I want to make sure that two people don't edit a document at the same time.

My users log in via a script that starts a session.

My initial idea was to have a field to denote file access (1 for "in
use" 0 for available).  The problem with this would be if a user
navigates to a different page or closes the browser window without
clicking a "save" or "close" button (which would execute a query to set
the in_use field to 0).

I'm sure others have dealt with the issue of exclusive access to a MySQL
resource.  I've looked into InnoDB transactional support, but that
doesn't seem to be what I need, since I'm not overly concerned about
simultaneously access, just simultaneous editing.

How can I ensure the "document" isn't accessed by two people at the same
time?

Thanks,
Bret


<< smime.p7s >>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux