If you got a problem Could not synchronize database state with session in hibernate and your are using sequence as primary key id generator.
You Should check highest sequence number from your sequence and max primary key of your table.
Arranging your Sequence if its out of order in Table.
IF YOU have sequence like :EMPLOYEE_SEQ
IF You have table like: EMPLOYEE
DECLARE
VAR_NUMBERSEQ NUMBER(10);
var_curr_seq number (10);
BEGIN
VAR_NUMBERSEQ :=0;
VAR_CURR_SEQ:=0;
WHILE VAR_CURR_SEQ<6624
loop
SELECT EMPLOYEE_SEQ.NEXTVAL INTO VAR_CURR_SEQ FROM DUAL;
end loop;
END;
You Should check highest sequence number from your sequence and max primary key of your table.
Arranging your Sequence if its out of order in Table.
IF YOU have sequence like :EMPLOYEE_SEQ
IF You have table like: EMPLOYEE
DECLARE
VAR_NUMBERSEQ NUMBER(10);
var_curr_seq number (10);
BEGIN
VAR_NUMBERSEQ :=0;
VAR_CURR_SEQ:=0;
WHILE VAR_CURR_SEQ<6624
loop
SELECT EMPLOYEE_SEQ.NEXTVAL INTO VAR_CURR_SEQ FROM DUAL;
end loop;
END;