Imagine there is a web-application where in multiple users are logged in . The user can fill and submit a form in it. Now when this request is processed behind the scene a table is maintained which keeps track of a number whenever such kinds of form submission is made which keeps on incrementing and this number is associated with the form that is submitted and sent to other system.
There can be a situation when in two different users log in at the same time and submit their forms . In such cases the number generated is same for both the user which is causing ambiguity . I have looked up and seen discussion on two phase commits , but is there anything in the procedure that can be done to achieve unique consistency.
The query is simple in the procedure that is used.
..... Start transaction update form_id_configuration set idValue = {lastvalue} + 1; ....
Has anybody come across this kind of situation . I want to achieve uniqueness.