We should keep this series of operations inside a transaction.