sequence nextval called twice on insert
grodnoDec 27 2011 — edited Dec 28 2011Hey,
myTableVO.id is populated by sequence nextval expression (update when new only)
there is a pre-insert trigger on table MyTable with a statement select nvl(:new.id,my_seq.nextval) into :new.id from dual; in it
each time a new row is inserted, i see the new id value is increased by 2, rather than 1.
the code in backing bean that manages the insert's attributes shows that the statement
res=newRow.getAttribute("Id").toString();
returns already doubled value.
what's wrong? how can i avoid calling nextval twice a call?