Frederik Zimmer created OLINGO-1325:
---------------------------------------

             Summary: EntityUUID - non-unique temp key
                 Key: OLINGO-1325
                 URL: https://issues.apache.org/jira/browse/OLINGO-1325
             Project: Olingo
          Issue Type: Bug
          Components: odata4-ext
    Affects Versions: (Java) V4 4.5.0
            Reporter: Frederik Zimmer


We are using ext-proxy and a deep insert which produces incorrect results when 
having many related entities. The reason for this is that in the class 
EntityUUID for new entities a tempKey is computed like this

this.tempKey = (int) (Math.random() * 1000000);

which for many newly created entities causes collisions so that two new 
different entities are considered equal by the equals method.

I think the whole point of the tempKey is to make new entities unique as long 
as they don't have a real key. Random numbers are not suited for that but you 
could make tempKey an object and then say

this.tempKey = new Object();

which should guarantee that every new entity is unique.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to