[zope2-tracker] [Bug 143917] Re: Memory leak in Shared.DC.ZRDB.Results.SQLAlias
Tres Seaver
tseaver at palladion.com
Fri Jan 29 15:55:37 EST 2010
The attached module has a Results class which provides a much stripped-down
form of the one in Shared.DC.ZRDB.Results. In particular:
- It doesn't alias column names (the source of the memory leak).
- It provides much more efficient mapping of a row index into a
dictionary keyed by column name.
It loses a bunch of seldom used features of the original class (methods not
implemented).
To deal with the weird calling convention Shared.DC.ZRDB.DA uses to create
results, it contains a factory function, 'makeZRDBResults', which expects
to be passed a single tuple, (items, data).
You should be able to monkey-patch this factory in via something like::
import Shared.DC.ZRDB.Connection
Shared.DC.ZRDB.Connection.Results = makeZRDBResults
import Shared.DC.ZRDB.DA
Shared.DC.ZRDB.DA.Results = makeZRDBResults
** Attachment added: "simple_rdb_results.py"
http://launchpadlibrarian.net/38537913/simple_rdb_results.py
--
Memory leak in Shared.DC.ZRDB.Results.SQLAlias
https://bugs.launchpad.net/bugs/143917
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
More information about the zope2-tracker
mailing list