You're implying that this might be a problem with a database key, but I suspect you're wrong -- because that's one of the problems that databases were specifically designed to solve. For example, if you do something inside a database transaction that involves incrementing a counter and then using it, there should never be a problem.
Give us a concrete example of what you're talking about (maybe to do with threads?), and we'll have a better idea of how to respond.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.