Ed,

You could indeed follow the Google suggested approach and ignore it.

Or consider it to happen infrequently and expect to catch most
violating situations by performing a find on email in the Datastore
before writing the User entity, maybe with some additional checks and
reporting during later data reads if the violation hadn't been
detected during the update.

In case you want to have it really watertight, you probably have to
use a separate Kind for your uniqueness monitoring (Key=email,
value=Key of user entity) and updated it together the User updates.
Features like global transactions and optimistic concurrency control
will be required so the low level API and JDO won't do and you will
have to use richer frameworks like Slim3.

Erwin.

On 2 feb, 23:14, "Ikai Lan (Google)" <[email protected]> wrote:
> That sounds like an edge case to me that you'd be overengineering for unless
> you had a specific use case. How often have you changed your email address?
> I think the last time I changed mine was when Gmail launched in ... 2003?
> 2004? The only exception is if you are building something business related
> and you need work emails - those will change each time you change a job.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blogger:http://googleappengine.blogspot.com
> Reddit:http://www.reddit.com/r/appengine
> Twitter:http://twitter.com/app_engine
>
> On Wed, Feb 2, 2011 at 1:21 PM, Jeff Schwartz <[email protected]>wrote:
>
> > If the user changes their email address then all entities using it as their
> > part of their key would have to be deleted from the datastore (you can not
> > update an entities ID) and then saved again using their new email address.
> > That's doable but very expensive and IMHO something to be avoided at all
> > costs and I'd look to use something else.
>
> > On Wed, Feb 2, 2011 at 2:34 PM, Robert Kluin <[email protected]>wrote:
>
> >> No but to implement a unique constraint, I find key_names are usually
> >> the easiest way.  But you're right, the email can change so he might
> >> need to add a second kind used  to track the uniqueness of that field.
>
> >> On Wed, Feb 2, 2011 at 12:58, Jeff Schwartz <[email protected]>
> >> wrote:
> >> > Since email addresses can change it isn't a good idea to use them in an
> >> > entity's id.
>
> >> > On Feb 2, 2011 12:41 PM, "dudu" <[email protected]> wrote:
> >> >> No solution folks? Any idea?
> >> >> How do you configure your unique fields?
>
> >> >> How can I use the email property to be part of the "Key".
> >> >> If is generated by* IDENTITY strategy*, do I need to interfere?
>
> >> >> Could someone just post some working code with a Key, and some unique
> >> >> fields?
>
> >> >> --
> >> >> 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]<google-appengine%[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]<google-appengine%[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]<google-appengine%[email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine?hl=en.
>
> > --
> > *Jeff Schwartz*
>
> >  --
> > 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]<google-appengine%[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.

Reply via email to