You can let app engine choose a unique key for you or use a
transaction to first query for an existing value and then put it only
if it does not already exist. In order to do the query and put in a
transaction the entities must all be in the same Entity group which
will reduce concurrency. If you can partition your unique values
somehow (e.g. A-D, E-H...) then you can have a root entity for each
partition to decrease contention.
On 5 Feb 2010, at 17:41, smile laugh wrote:
would someone be so kind to give me an answer.
thanks
On Feb 4, 1:20 am, smile laugh <[email protected]> wrote:
I have another question.
to a unique field which cannot have same value, before I insert a
record , I must check if there is same value in the field.
it seems impossible to make the constraint in cloud platform.
because when I insert the record , maybe other one can insert the
same
record at the same time. that will break uniqueness of the field .
thanks in advance
laughsmile
--
You received this message because you are subscribed to the Google
Groups "Google App Engine for Java" 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-java?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Google
App Engine for Java" 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-java?hl=en.