You can define the Id and use a counter to increase.
http://saepy.sinaapp.com
在 2012-8-7,20:08,Neo <[email protected]> 写到:
Hi Jeff,
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 view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/sO0eNtmB784J
.
To post to this group, send email to google-
[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
.
--
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.