CachingPubsubPersistenceProvider periodically flushes state changes to the database, to ensure that those changes are persisted.
When Openfire is shut down, and changes are cached, those should be persisted prior to shutdown, to prevent them from being lost completely.