Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Changed post commit behaviour for duplicate entries in IndirectList?

In general your add methods (addParameter), should first check if the value
is in the collection.  Or use a Set.


Jaap Spiering wrote:
> 
> 
> 
> 
> Hi,
> 
>  
> 
> we are currently using EclipseLink 1.1.2, just upgraded from Toplink
> 10.1.3.3.0.
> 
>  
> 
> We are observing the following change in behaviour, when using the native
> API and bidirectional relationships.
> 
> When using a bidirectional relationship, it only needs to be set through
> one side. Unfortunately we have parts of our code where the relationship
> is set from both sides.
> 
> For example:
> 
>  
> 
>       parameter.setCommandItem(commandItem);
> 
>       commandItem.addParameter(parameter);
> 
>  
> 
> This leads to the “parameters” Collection (IndirectList) on the
> CommandItem entity having the same Parameter object added twice.
> 
> At commit time, the UnitOfWork detects that only one distinct Parameter
> was actually added and only commits one entry to the database.
> 
>  
> 
> In Toplink 10g, the duplicate entry from the Parameter collection would be
> removed after the commit. Now, with EclipseLink 1.1.2, the duplicate
> remains in the Collection.
> 
> Unfortunately, the application relies on the post-commit clone object
> having the correct number of items in its Collection.
> 
>  
> 
> I’ve searched the EclipseLink BugZilla, but have not found an issue that
> could be related to this change in behaviour.
> 
> Is there a particular reason for this change in behaviour of no
> longer merging these changes back into the clone object?
> 
>  
> 
> kind regards,
> 
>  
> 
> Jaap Spiering
> 
>  
> 
> 
> [Oracle] (http://www.oracle.com/)
> Jaap Spiering | Development Specialist
> Phone: +31 (0)30 669 8331 | Fax: +31 (0)30 669 9966
> Oracle Consulting - Benelux SOA
> ORACLE Nederland BV | Rijnzathe 6 | 3454 PV De Meern
> 
> Oracle Nederland BV, PO-box 147, 3454 ZJ De Meern
> KvK nr.: 30096087 | www.oracle.nl (http://www.oracle.nl/)
> 
>     [Green Oracle] (http://www.oracle.com/commitment)    Oracle is
> committed to developing practices and products that help protect the
> environment
> 
> 


-----
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://old.nabble.com/Changed-post-commit-behaviour-for-duplicate-entries-in-IndirectList--tp26499404p26579679.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top