def commit(self, cursor=None, close=1):
        """ commit the cursor and create the result set """
        if cursor and cursor.description:
            self.headers = cursor.description
            self.results = cursor.fetchall()
            if hasattr(cursor, "nextset"):
                s = cursor.nextset()
                while s:
                    self.results += cursor.fetchall()
                    s = cursor.nextset()
        if hasattr(cursor, "lastrowid"):
            self.lastrowid = cursor.lastrowid
        if hasattr(cursor, "updatecount"):
            self.updatecount = cursor.updatecount
        if not self.autocommit or cursor is None:
            if not self.db.autocommit:
                self.db.commit()
        if cursor and close: cursor.close()
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/dbexts.py/dbexts.commit/original