def check_commit(self, force=False):
self.commit_count = self.commit_count + <NUM_LIT:1><EOL>if force or self.commit_count >= <NUM_LIT:100>:<EOL><INDENT>self.commit_count = <NUM_LIT:0><EOL>self.conn.commit()<EOL><DEDENT>
当修改数据库超过100次后, 就自动commit数据.