Mamta Satoor wrote: > I looked at the SQL 2000 spec to see what it says about generated keys. > Following are some lines copied from the Identity columns section and > from Sequence generators section. The value generation for identity > column follows the gules of Sequence generator. And in the Sequence > generator section, the spec says that value generation is done in a > transaction of its own and is not associated with the outside user > transaction.
Right, thinking about this more and looking at the SQL spec, I was wrong here. The generation of sequence numbers is independent of any unique index and so Derby needs to follow the SQL standard. The fetch the max value works for the *specific* case that the value is a duplicate in a unique index, but doesn't work for other failure cases, say a CHECK constraint failing. Thus the only rational thing to do is to follow the standard as Mamta indicates. Dan.
