cyclades: Do not save stale objects after a commit
Call to issue_and_accept_commission saves the resource object (eg a vm) and commits the transaction. This has the side-effect that the resource object becomes stale: its lock is released and another thread may acquire it and update the db record. It is thus not safe to further update and then save the stale object, since this would override others' changes. Instead, lock and fetch the object again, where needed.
Showing with 16 additions and 7 deletions