[OEM-188] Don't write to database unless things have changed.