Run package updates in transaction batches
Run package updates in transaction batches

Currently the gen_host_updates() method, which runs once per host, does
the following:
  1. deletes all Updates for the host
  2. inserts new Packages
  3. inserts new Updates

Because of Django's autocommit, each of these steps is running on a
transaction on its own, commiting as soon as the step completes.

Use the @transaction.commit_on_success decorator instead to run all
three steps on a single transaction. Note that this is a transaction
*per host*, not a single transaction for all package updates, as there's
no reason to do so.

apoikos/servermon,apoikos/servermon