Write all history entries in one transaction.