You are here: Re: [PHP] Re: Getting the process ID « PHP « IT news, forums, messages
Re: [PHP] Re: Getting the process ID

Posted by Josh Whiting on 03/25/05 05:55

> The problem I am having is that people are double-submitting certain
> transactions. My first attempt to prevent this was to store a flag in the
> session record indicating whether or not certain transactions had been
> completed, but this turned out to be insufficient at times because users
> could try and initiate a second transaction before the first transaction had
> finished (and thus the system had not yet flagged the transaction completed
> in the session record). They then both completed in parallel, and voila,
> duplicate transactions again.
>
> I realized that this sort of problem would always exist unless I had some
> sort of semaphore mechanism. Once a user has *started* a transaction, they
> need to be prevented from initiating a second transaction until the first
> transaction has been completed.
>
> I am open to suggestions on how to do this. What is the best way?

do you have access to a database? why not just manage the transaction
on the database level? transactions, locking, etc. are a core part of
what databases do for a living. it's not a problem best solved with PHP.

/josh w

 

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

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