the number of Handles (some kind of limited resource on MS Windows,
visible in the Windows Task-Manager) my application uses increases
every time I use doInTransaction(). IMO the cause for this is that
doInTransaction() creates a temporary connection which caches the
entities, which remain cached, even after commiting and restoring the
The attached patch solves the problem.
From: Markus Gritsch <m.gritsch@gm...> - 2007-03-27 20:02:22
On 3/27/07, Oleg Broytmann <phd@...> wrote:
> Why not just
Yes, you are right, that would of course be the better solution.
However, it seems that I can avoid the problem by performing just the
SQLObject relevant part of code in the function passed to
doInTransaction(), and have the rest of the code outside of that
function. It seems that the values only stay in the cache if the GUI
relevant code was also in the function which I passed to
doInTransaction(). So probably just false alarm :)
However I have one more question: I used to set the connection using
sqlhub.processConnection = connectionForURI(...)
which is the way the SQLObject documentation describes at
http://www.sqlobject.org/ and http://www.sqlobject.org/SQLObject.html.
To switch between different databases, I set sqlhub.processConnection
to the desired DB, which worked fine. Now, after calling
doInTransaction() this works no more. I suppose the problem is, that
doInTransaction() restores the old connection unconditionally to
sqlhub.threadConnection, although self.getConnection() returned the
sqlhub.processConnection in my case. And since
sqlhub.threadConnection is set now, changing sqlhub.processConnection
in my code has no effect anymore.
On Tue, Mar 27, 2007 at 10:02:17PM +0200, Markus Gritsch wrote:
> So probably just false alarm :)
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.