On Sun, Feb 08, 2009 at 06:16:01PM -0500, Stef Telford wrote:
> seeing about 190 connects/disconnects on the postgreSQL side. Now,
> since a connection is costly (believe me, it is ;), how can I get
> these down to (in theory) 1. I know that may seem unrealistic, but
> still, there shouldn't be 190 connects/disconnects.
> 
>     This -is- a single threaded environment, I do print out during the
> select in main.py and the connection -is- the same (same memory ref),
> I don't use selectBy either.
> 
>     I am kind of scratching my head here. Could it be that the joins
> in the class don't honor the classes connection?

   Whatever joins use - they use SQLObject's DBConnection objects that are
high-level wrapper around Python DB API connections. Every DBConnection
instance maintains a pool of opened DB API connections and opens a new
DB API connection only if the pool is empty (the first query or all DB API
connections are busy in other threads). Hence there shouldn't be
connects/disconnects, especially in a single-threaded program.
   The only way to make implicit connects/disconnects is to disable
connection pooling. You haven't done that, have you? connection._pool is
not None?

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            p...@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to