get_or_insert is very annoying to use. First it doesn't tell you
whether it is a  get or insert at the end. 2nd it cannot be
encapsulated in another transaction.

On Dec 12, 4:21 pm, "Sharp-Developer.Net"
<[email protected]> wrote:
> And there is a get_or_insert() method.
>
> I guess it's waiting for active transactions to be completed and could
> be used for synchronization.
> --
> Alexhttp://sharp-developer.net/
>
> On Dec 12, 8:07 pm, ryan <[email protected]> wrote:
>
> > if you create an entity with the same key as an existing entity, e.g.
> > you do Foo(key_name='bar').put() in one request, then you do the same
> > thing in another request, the second put() will overwrite the first.
>
> > if this happens in two concurrent transactions and they collide, one
> > of the transactions will retry and do its put() again, overwriting the
> > first one.
>
> > if the put()s are outside transactions, it's much less likely that
> > they'll collide. it's still possible that the datastore could attempt
> > to perform those writes at the same time, but it's much less likely.
--~--~---------~--~----~------------~-------~--~----~
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