Removed updateEntityProperties's transactionality
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 28 Feb 2009 00:41:36 +0000
changeset 1549 bd07b231fe39
parent 1548 15caebd3304d
child 1550 a872030dc3ca
Removed updateEntityProperties's transactionality entity.put() is already transactional, and all other methods called do not need transactionality (even so, it is hurtfull that they are run within a transaction). Patch by: Sverre Rabbelier
app/soc/logic/models/base.py
--- a/app/soc/logic/models/base.py	Sat Feb 28 00:10:07 2009 +0000
+++ b/app/soc/logic/models/base.py	Sat Feb 28 00:41:36 2009 +0000
@@ -334,23 +334,6 @@
     if not entity_properties:
       raise InvalidArgumentError
 
-    def update():
-      return self._unsafeUpdateEntityProperties(entity, entity_properties)
-
-    entity = db.run_in_transaction(update)
-
-    # call the _onUpdate method
-    if not silent:
-      self._onUpdate(entity)
-
-    return entity
-
-  def _unsafeUpdateEntityProperties(self, entity, entity_properties):
-    """See updateEntityProperties.
-
-    Like updateEntityProperties(), but not run within a transaction.
-    """
-
     properties = self._model.properties()
 
     for name, prop in properties.iteritems():
@@ -363,6 +346,11 @@
         prop.__set__(entity, value)
 
     entity.put()
+
+    # call the _onUpdate method
+    if not silent:
+      self._onUpdate(entity)
+
     return entity
 
   def updateOrCreateFromKeyName(self, properties, key_name):