Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Data loss within postCalculateUnitOfWorkChangeSet() event

The event postCalculateUnitOfWorkChangeSet is raised after (post) computing
what will be written, so it is too late to write anything else, you would
need to use the preCalculateUnitOfWorkChangeSet for this.

How are you persisting your object in postCalculateUnitOfWorkChangeSet?  You
might need to register them, or add their change set to the
UnitOfWorkChangeSet.


patric-5 wrote:
> 
> Hello everyone,
> 
> I am using a SessionEventListener to persist new objects during the  
> postCalculateUnitOfWorkChangeSet() event.
> 
> These objects won't get persisted in the next writeChanges() call  
> (e.g. flush/transaction commit) by the UnitOfWork. The UnitOfWork  
> doesn't recognize the new objects as new, isObjectNew(object); returns  
> false.
> 
> As a consequence, the UnitOfWork does an update instead of an insert  
> (which of course fails because the record doesn't exist, but without  
> an exception) - the object is lost.
> 
> Are there any workarounds for this bug?
> 
> 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 
-- 
View this message in context: http://www.nabble.com/Data-loss-within-postCalculateUnitOfWorkChangeSet%28%29-event-tp25063949p25138995.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top