On Thu, 2002-03-21 at 08:09, Renaud Guérin wrote:
En réponse à "Matthew T. Kromer" <matt@zope.com>:
No, its not OK -- two threads executing at the same time will generate an identical MAX(ID) + 1. Thats why you have to use an Oracle Sequence.
Actually, I do believe that most (all?) databases have a low-level field, often called a rowid, which you can use. I seem to remember that you can get access to, and refer to, the rowid of any particular record in a table. That would solve the problem of not being able to create a sequence, and it would guarantee that you never got an ID collision. I don't remember the semantics of how to access it in Oracle, though. Sorry. -- Colin Fox cfox@crystalcherry.com CF Consulting Inc. GPG Fingerprint: D8F0 84E7 E7CC 5C6C 9982 F1A7 A3EB 6EA3 BC97 572F