[cx-oracle-users] Re: Need fetchall invalidate LOB locators?
Brought to you by:
atuining
From: Hamish L. <ham...@gm...> - 2005-07-15 21:15:48
|
Anthony Tuininga wrote: > without looking at the code I would guess that [DCOracle2] define new > LOB locator variables for each of the rows that are fetched. That > seems to me to be a lot of overhead for very little gain -- unless you > can give me some valid reason for why fetchall() is a good idea when > dealing with LOBs. The main reason I'd offer is completeness and to avoid special-casing. I've been working on the contribution of an Oracle driver to the PyDO 2 ORM project, and I've been obliged to reimplement one of the inherited core methods just because it uses fetchall; I can envisage other situations where code that is not our own might expect to be able to call fetchall. You are right of course that there is a memory overhead in allocating LOB locator variables for each row. But any time the programmer chooses between fetchall and fetchone/iteration, they are deciding on a trade-off between memory and time costs. Why for the special case of the resultset's having LOBs should cx_Oracle remove that choice from the programmer? Hamish Lawson |