Finalize database changes.