Skip to main content

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

You need to call flush() after the remove().


patric-7 wrote:
> 
> 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
> 
> 
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Order-of-operations-in-EclipseLink-tp30551198p30607959.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top