[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Order of operations in EclipseLink

Hi,

imagine a simple table/entity TestTable with an AK on column status.

The following operations will fail using EclipseLink:

TestTable tt = new TestTable();
tt.setStatus("BLA");
em.persist(tt);
em.flush();

em.remove(tt);

TestTable tt2 = new TestTable();
tt2.setStatus("BLA");
em.persist(tt2);
em.flush(); //this will throw an exception due to AK violation


However, I would expect a successfull run because I previously removed the record which has the same AK.


It seems that the operation order is modified by EclipseLink -
inserts seems to be executed first which might change the outcome of a set of operations.
Is this an intentional behaviour?
If it is, is there a possibility to preserve the operation order?


Thank you and best regards,
Patric