'Update the DB object.'

def _update_router_db(self, context, router_id, data):

    with context.session.begin(subtransactions=True):
        router_db = self._get_router(context, router_id)
        old_router = self._make_router_dict(router_db)
        if data:
            router_db.update(data)
        registry.notify(resources.ROUTER, events.PRECOMMIT_UPDATE, self, context=context, router_id=router_id, router=data, router_db=router_db, old_router=old_router)
        return router_db
