google app engine - GAE: Prevent inadvertent overwriting of data -
suppose have entity person 2 properties: class person(ndb.model) payments = ndb.integerproperty(default=0) name = ndb.stringproperty() i thinking update payments in transaction not need transactions when updating name . however, seems in following scenario, lose value of payments : time | instance1 | instance2 (in transaction) ===================================================== || | person1 = key1.get() | || | person1.name = "john" | person1 = key1.get() || | [other stuff that] | person1.payments = 100 || | [takes time] | person1.put() || | person1.put() | || | \/ in scenario, seems instance1 overwrite payment amount written in instance2 , payment amount lost. does mean need use transactions when updating name make sure important data never lost? or more generally, if using transactions update property of entity, should use transactions updates entity? yes, lose new value