Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [PHP-DB] Multi-User Update Problem
Its a tough one. My personal fav is to mark the record as locked by changing
a field called 'locked' from 0 to 1. Check for this when extracting the
record and if is present, alert the user this record is locked (if you want
to get fancy you could even track who locked it and the tell the user that)
and show a non-updatable form of the page (either with the fields as
readonly or by creating some kind of view only page where the data is simply
echoed out). If you want to get REALLY out there, you could track who
requested the locked record and notify them when it was released(by the
original requestor submitting the form). The possibilities are endless

The other option is to create/write an entire concurrency module that will
store the record in a separate entity (another table or session object)  and
then compare any changes made upon submission. I have seen this but I don't
really like it, since the ultimate choice is left to the user as to what
data is correct.



Bastien

>From: "SCALES, Andrew" <Andrew.SCALES@eur.crowncork.com>
>To: php-db@lists.php.net
>Subject: [PHP-DB] Multi-User Update Problem
>Date: Mon, 29 Nov 2004 11:16:08 -0000
>
>Hello,
>
>Does anyone know a good way of locking out access to a record on a MySQL
>database when someone has the update page open?
>The problem is that we have a local intranet site which is accessed by
>members of different departments. Now at the moment when someone loads the
>page all of the data is pulled into the form, and then when they submit,
>all
>of that data is passed back to the database, including anything they
>haven't
>changed.
>
>What we are trying to avoid is situations where for example someone leaves
>the form open on their computer and goes away for lunch. In the meantime
>someone else at a different station makes changes to the form. Then when
>the
>first person comes back from lunch, they submit the form, thereby writing
>over all of the second person's changes with the old data.
>
>Does anyone know of a good way to solve or work around this problem? We
>have
>thought about setting a flag on the database whenever someone pulls down
>the
>data, however if their browser crashes or they shutdown with the window
>open
>then this is going to leave the data locked.
>
>Thanks very much,
>
>Andy
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bastien Koert
11-29-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:50 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.