'Commits pending transaction if :attr:`can_commit` or `force` is `True`
:param force: force commit, ignore :attr:`can_commit`'

def commit(self, force=False):

    if (force or self.can_commit):
        if (self._pending_connection is not None):
            self._pending_connection.commit()
