Hi,

Given the nature of the "put" function (low level hrd API), how can I
atomically put a new entity without overwriting an existing one if the
keys are chosen by the users (String values)?

Let's say I have 2 simultaneous users that creates at the same time an
entity of kind "User" with the custom key "johndoe" (because the user
name is the key), I don't want the second one to overwrite the
first...

I don't want to have a property for the username since I'll have the
same "unique index" problem.

Is a transaction with a:
1) get
2) catch EntityNotFoundException
3) put
4) commit

enough to ensure consistency ?

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 google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to