I am currently working on a website which allows a prospect to generate a quote and purchase a policy. After they submit their payment the application should generate a policy number.
I was given a block of policy numbers to use incrementally. For this example, let's say 0100800 - 0100999. If I have two or more people who decide to purchase a policy at the same time, What are some best practices/algoithms to make sure I don't generate the same policy number for two or more people?
It's also possible that after the last available policy number 0100999, I may be given another block of policy number for example 0222100-0222399.