'Periodically commit changes into the SQLite database.
Committing every operation is quite expensive, and slows down the
operation of the script. Thus, we only commit after every N operations,
as determined by the self.commit_periodicity value. Optionally, the
caller can force a commit.
Args:
force_commit: Pass True in order for a commit to occur regardless
of the current operation count.'

def _MaybeCommit(self, force_commit=False):

    self.operation_count += 1
    if (force_commit or ((self.operation_count % self.commit_periodicity) == 0)):
        self.secondary_conn.commit()
