Reply to Re: How do I handle people going into the same record at the same in web app.

Your name:

Reply:


Posted by Jerry Stuckle on 05/23/06 03:32

rich wrote:
> Someone gave me even a better idea. Use sessions in a table. Add to
> each user session a field for the Key field of each table in your
> database that is important. Example use the key field for a customer
> record. When you query the record for a change, write to that customer
> field in your seesion table the index of the record you are on.
> Whenever anyone opens that record, the ffirst thingyou do is query for
> the record number you are going to change and if it is found you cannot
> select the record because someone else has it open. Set your session
> max life time low enough so that a user can't sit on a record too long.
> This saves a person alot of work entering data only to be told someone
> else was using the record. I think this is a nice way of doing it.
>

First of all, one client cannot generally access the session data of another
client. You'd have to have some special handling in there.

Second, session data is buffered. It isn't necessarily written to the session
when you save it in the $_SESSION variable. So even if you do have a special
session handler, it may not have received the data from the first client when
the second client searches sessions.

Next, if the first client retrieves a record then shuts down his browser, the
second client will find the data in the session until the session times out -
which may be minutes or days (or even years) later. You should avoid locking
rows while waiting for user input.

All kinds of problems here - one of the worst solutions.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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