Add a transaction around object commits

(helps performance)