It could happen that, while Odoo is still sending emails, a subject receives it and clicks on accept/reject links.
In such case, he'd get a 404 error because the record wouldn't exist yet in the database. That's because the DB commit was made only after processing all the sent emails.
We need to commit in advance to make sure that doesn't happen.