How can I implement a user name availability check on the google app engine?

Posted by Spines on Stack Overflow See other posts from Stack Overflow or by Spines
Published on 2010-03-30T23:47:23Z Indexed on 2010/03/30 23:53 UTC
Read the original article Hit count: 312

Filed under:

When someone signs up for my website they must sign up with a unique user name. My current pseudocode for this is:

if(datastore.nameIsAvailable(name)){
    datastore.createUser(name);
}

How do I make sure that in between the time when nameIsAvailable returns true, and the createUser is finished, another instance of my app doesn't create a user with the same name?

© Stack Overflow or respective owner

Related posts about google-app-engine