def model_from_xml(self, model_el, model_name, model_handler, key,
                       is_replace):
        if(model_name != str(model_el.nodeName)):
            raise TypeError("wrong model name, found '%s', expected '%s'" %
                            (model_el.nodeName, model_name))

        props = model_handler.read_xml_value(model_el)

        given_key = props.pop(KEY_PROPERTY_NAME, None)

        if(key is MULTI_UPDATE_KEY):
            if(given_key):
                key = str(given_key)
            else:
                key = None

        new_model = False
        if(key):
            key = db.Key(key.strip())
            if(given_key and (given_key != key)):
                raise ValueError(
                    "key in data %s does not match request key %s" %
                    (given_key, key))
            model = model_handler.get(key)

            if(is_replace):
                for prop_name, prop_type in model.properties().iteritems():
                    if(prop_name not in props):
                        setattr(model, prop_name, prop_type.default_value())
                for prop_name in model.dynamic_properties():
                    delattr(model, prop_name)

            for prop_name, prop_value in props.iteritems():
                setattr(model, prop_name, prop_value)

        else:
            new_model = True
            model = model_handler.create(props)

        # check for model specific etag attribute (ignore for new model)
        if(self.enable_etags and (not new_model) and
           (model_el.attributes.get(ETAG_ATTR_NAME, None) is not None)):
            model.in_model_hash_ = str(
                model_el.attributes[ETAG_ATTR_NAME].value)

        return model
The commit_on_success context manager also works with a using argument.
dataset/ETHPy150Open jahlborn/appengine-rest-server/src/main/python/rest/__init__.py/Dispatcher.model_from_xml--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/tests/modeltests/transactions/tests_25.py/TransactionContextManagerTests.test_commit_on_success_with_using