Bug 945779 - Use transactions to batch up I/O. r=honzab