[pmwiki-devel] simultanouis form submission problem

Hans design5 at softflow.co.uk
Thu Sep 25 15:36:02 CDT 2008


What is the best way to solve following problem:

A form lets a user add a row of data, and this row is identified by
an id rownumber, which is written as a PTV, and incremented by 1 with
every form submission.

Now two (or more) users submit this form at the same time more or
less exactly (less than 2 seconds of each other). How can it be
guaranteed that each row will be allocated a correctly increased
rownumber?

I tried to force the processing script to read the rownumber PTV when
the form is processed, rather than using the PTV as given when the
page loads. This helps for the cases where the form submissions takes
place some seconds or more apart, i.e. when the page is written fully
before the second submission takes place.

But near simultaneous submissions still end up with duplicated
rownumbers.

Any ideas are much appreciated! Thanks!

Hans




More information about the pmwiki-devel mailing list