|
From: Yuval T. <yu...@il...> - 2003-10-26 19:04:34
|
Yuval Turgeman wrote:
> 4. We clear the cursor data prior to fetching instead of after
> fetching - this can cause leaks. After we converted the data to
> pyobjects, we need to clear the data. So, to fix this (potential)
> problem I did the following:
> A. I changed the name of DB2_cursor_object_fetchone to
> DB2_cursor_object_do_fetch, and created the following new wrapper
> function:
>
> static PyObject *
> DB2_cursor_object_fetchone(DB2CursorObject *self, PyObject *args)
> {
> PyObject *pRet = DB2_cursor_object_do_fetch(self, args);
> DB2_cursor_object_clear_data(self);
> return pRet;
> }
>
> B. In fetchall and fetchmany, I changed the calls from fetchone to
> do_fetch, and added a calls to DB2_cursor_object_clear_data(self); at
> the end of the loops.
Disregard this specific issue - I just saw that in DB2.py, we call
several times to self._cs.fetchone() and never call to the C
functions. Why is that by the way?
Anyway, this makes the fetching issue irrelevant (and the suggested fix
above doesn't work as well)
--
Yuval Turgeman
Content Technology, Aduva LTD.
|