You are here: Re: A Question of design. « PHP Programming Language « IT news, forums, messages
Re: A Question of design.

Posted by Daz on 10/24/06 19:40

Chung Leong wrote:
> Then you end up with a race condition, I think even if a transaction is
> used. If there are two threads trying to insert the same data running
> simultaneously, a transaction would not block the second thread from
> fetching the same result set as the first. Thus both threads could
> think that a particular record doesn't exist and both would insert it.
> You would need to lock the table for the duration of the entire
> operation, which is pretty lousy.

I am going to need to create a function that checks for duplicate
entries I think. However, the only time that there would be any chance
of a race condition, would be if the same user was logged on twice, and
carried out the same action symaltaniously. Baring in mind that there
is only an appromimately 0.1 second window (as this is how long the
transaction takes), I think it's very slim that it would happen. A user
shouldn't need to run the same thing twice symaltaniously, however, I
think I may start looking into methods that will log the user out of
one account if they login a second time with another.

Basically, I acknowledge there is a very slim chance of having
duplicate entries, but how else could I get around this?

All the best.

Daz.

 

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

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