On May 2, 5:01 pm, Ricky Button <[email protected]> wrote: > I have a question regarding auto-assigned ids for entities. Let's say > I have some set of entities that have the ids: > > 1 > 2 > 3 > 4 > 5 > > And I remove the 4th one: > > 1 > 2 > 3 > 5 > > If I add a new entity with an auto-generated ID, is it guaranteed that > the new ID will not be 4 and WILL be something greater than 5?
In your particular case, yes. IDs are only assigned once for a particular entity group and kind, so 4 will not be reused. In general, there's no guarantee that the IDs will be monotonically increasing, but since in your example all of the numbers >= 5 have been used, you can be sure that the value you get won't be less than 5. IDs are assigned to instances in batches, so it's entirely possible that a lower value from an earlier-assigned batch will get used for an entity created later than one with a larger ID. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
