You are here: Re: How do I handle people going into the same record at the same in web app. « PHP Programming Language « IT news, forums, messages
Re: How do I handle people going into the same record at the same in web app.

Posted by ImOk on 10/26/77 11:48

Method 1) The easiest way would be to have on each table a last
modified timestamp and user.
Before writing, check the timestamp and user (see Method 2) and see if
it was changed since you read it last. If different, then pop up a
message for appropriate action (force overwrite or reload).

Caveat: If other apps modfying the database and dont honor timestamp
you could have a problem. Of course you can have a trigger in the
database to force a time stamp write on each update so no one forgets.

Method 2) Test the columns like suggested above and display message.
BUT you still need Transaction based updates in case of more than one
table.

If you have to apply the changes to multiple tables (relational stuff),
then you do need the begin transaction/commit/rollback in case any
tables have changed.

Begin Transaction

Select * from A with lock
Select * from B with lock

If any columns (or timestamp/user) of above cursors changed
Rollback/Error
else
Update
Commit
endif

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация