I need to generate and ID (a number sequence prefixed with a string) for a record from a c# application and store it in MYSQL, in turn when another record needs to be created the previously created records Id is fetched and it is incremented.
My question is, when the application is used by multiple users how can we guarantee that the same id will not be accessed at the same time. Moreover I assume we will need some locking mechanism, if so what is the best way to implement it.
Thanks,