Ten MySQL Best Practices
Subject:   Alternative to point number 6
Date:   2008-01-27 17:33:21
From:   zhalbrecht
Response to: Alternative to point number 6

Oh no. no. no no no no no. Please don't do this. How are you guaranteeing that someone else won't do the same thing at the same time? Think the chances of that are so small you'll never have to worry? Start worrying. As someone who has had to fix this kind of issue let me assure you that problems will occur. You've made no mention of transactions and even at that point wrapping your own INSERTs in transactions manually, you really are reinventing the wheel.