Let say i have only one record in my invoice table.
When iserting a new row in my invoice table and in case of an error, i get this message :"The statement has been rolled back".
Now if i insert a new invoice, the id i get in the invoice table is id=3 insted of id=2.
here is my invoice table DDL:
CREATE TABLE "APP"."INVOICES" ("ID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), "INVOICEDATE" DATE NOT NULL, "ISCASHINVOICE" BOOLEAN NOT NULL, "CUSTOMERID" INTEGER, "DISCOUNT" DECIMAL(12,2), "ADDITIONALCHARGE" DECIMAL(12,2), "ADDITIONALTVACHARGE" DECIMAL(12,2),"GARANTIEID" INTEGER,"INVOICETOTAL" DECIMAL(12,2),"TYPEPAYEID" INTEGER , "ISPAYEINVOICE" BOOLEAN NOT NULL DEFAULT FALSE);
how to solve this problem the invoice id should auto increment normally.
i did add this :
System.setProperty("derby.language.sequence.preallocator", "1");
the probleme still persiste