|Re: [eclipselink-users] Order of operations in EclipseLink|
See the following link
The above link shows how to configure it using UnitOfWork. Is there a way to do it using the EntityManager?
On 12/30/2010 4:56 PM, Michael Simons wrote:
Hi Patric, AFAIK it is an intentional behaviour, EL just like any other JPA/JDO implementation that we've used (EL, OpenJPA, etc) do inserts before deletes. I don't remember the reason. I just remember there was one. Maybe someone else can explain that to us. To keep the AK you can either flush right after the delete or replace the delete/insert by an update. -Michael -----Ursprüngliche Nachricht----- Von: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] Im Auftrag von patric@xxxxxxxxxxx Gesendet: Mittwoch, 29. Dezember 2010 14:27 An: EclipseLink-users@xxxxxxxxxxx Betreff: [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 _______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users _______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Thanks and Regards
Member Technical Staff
Oracle Server Technologies