Daniel John Debrunner wrote:
Satheesh Bandaram wrote:
  
I would be happy if Derby can consume identity values even if current
insert statement fails. For this case, some insert statements may fail
when they generate a value that is already present. But subsequent
inserts should pass.
    

I wouldn't! I think you are saying that it's ok for inserts to fail
until a value is found that is not currently used. If I pre-loaded a
table with 100,000 rows with consective values, then it's going to
require 100,000 subsequent failing inserts before one succeeds. Ie. the
counter has gone beyond the max value used. That would result in very
unhappy customers in an e-commerce site
I suppose that is another way to solve the problem... When I filed the bug in Jira, what I proposed would have been sufficient for me. If you or Mamta have itch for a different solution, that is fine too. But I wouldn't expect users to want to skip 100,000  values by issuing that many failed inserts. That is usually done by ALTER TABLE command, that sets START WITH option. While Derby already supports changing INCREMENT BY using ALTER TABLE, I think there is a pending enhancement to enhance ALTER TABLE to allow setting STARTS WITH value.

Satheesh




Reply via email to