'Fetch the next set of rows of a query result, returning a list of tuples. An empty sequence is returned when no more rows are available.
The number of rows to fetch per call is specified by the parameter.
If it is not given, the cursor\'s arraysize determines the number of rows to be fetched.
The method should try to fetch as many rows as indicated by the size parameter.
If this is not possible due to the specified number of rows not being available,
fewer rows may be returned.
An Error (or subclass) exception is raised if the previous call to executeXXX()
did not produce any result set or no call was issued yet.
Note there are performance considerations involved with the size parameter.
For optimal performance, it is usually best to use the arraysize attribute.
If the size parameter is used, then it is best for it to retain the same value from
one fetchmany() call to the next.'

def fetchmany(self, size=None):

    self.messages = []
    if (size == None):
        size = self.arraysize
    return self._fetch(size)
