You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means you can call allocateId on a key with a prepopulated ID, and the server will actuall allocate a completely different ID. This behavior is documented, but it seems surprising. Would be safer to either reject the allocateId call if the provided key contains an ID/name (or just let the server reject the call).
The current behavior is to "trim" the ID or name from the final path element before sending the key to the server:
https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java#L114
This means you can call
allocateIdon a key with a prepopulated ID, and the server will actuall allocate a completely different ID. This behavior is documented, but it seems surprising. Would be safer to either reject theallocateIdcall if the provided key contains an ID/name (or just let the server reject the call).Reference:
http://stackoverflow.com/questions/41878706/where-is-allocateids-in-the-google-cloud-datastore-java-library/41879429