Now you have me confused. I thought you want every URLInfo to have a unique id? This is what the allocator will give you. It generates unique ids at ferocious rates across an entire cluster of active machines.
If you somehow want URLInfo objects to share ids, I don't really understand your business problem. If you're just looking for a way to ensure that multiple servers don't create the same URLInfo object at the same time, you need to create the URLInfo in a transaction that checks for existence of the URLInfo before writing. Jeff On Tue, Aug 7, 2012 at 5:08 AM, Neo <[email protected]> wrote: > > Actually my requirement is that , Whenever I save a new entity, the id field > should get autogenerated. If I have to do it on my own (as you suggested > DatastoreService.allocateIds()), how do we handle scenarios like two threads > on different machines trying to store the newly created entites in the > datastore (thereby trying to assign different ids). I am not well versed > with all the concepts. If you can please elaborate, that would be really > useful. And you are right in guessing that I need the shortest possible > value. Hashes, I suppose are not guaranteed to be unique for two different > arbitrary strings. > > Thanks, -- 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.
