<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_db(self, new_values):
 """Update database values and application configuration. The provided keys must be defined in the ``WAFFLE_CONFS`` setting. Arguments: new_values (dict):
 dict of configuration variables and their values The dict has the following structure: { 'MY_CONFIG_VAR' : <CONFIG_VAL>, 'MY_CONFIG_VAR1' : <CONFIG_VAL1> } """

        confs = self.app.config.get('WAFFLE_CONFS', {})
        to_update = {}

        for key in new_values.keys():
            # Some things cannot be changed...
            if key.startswith('WAFFLE_'):
                continue

            # No arbitrary keys
            if key not in confs.keys():
                continue

            value = new_values[key]
            self.configstore.put(key, util.serialize(value))
            self.configstore.commit()

            to_update[key] = value

        # Update config
        if not to_update:
            return

        self.app.config.update(to_update)

        # Notify other processes
        if self.app.config.get('WAFFLE_MULTIPROC', False):
            self.notify(self)