On Sat, Dec 13, 2008 at 07:26:14PM +0200, Iwan Vosloo wrote:
> In pgconnection.py, line:
> 163           if self.server_version[:3] <= "7.2":
> 
> the attribute access to server_version results in a "poor mans
> aquisition" call to the method server_version on the Transaction's
> _dbConnection (a PostgresConnection).
> 
> In there, on line:
> 304               server_version = self.queryOne("SELECT version()")[0]
> 
> A query is executed on the underlying db connection.
> 
> This is where the extra connection is created (the original is already
> in a transaction at this point).  If this query is done manually on the
> Transaction object, instead of on its underlying connection, everything
> works as it should.
> 
> So, it seems (from our limited understanding) that it should not have
> gone this far, and rather should have executed the query on the
> Transaction object itself.

   When the connection calls self.queryOne() - is 'self' the connection or
the transaction? Transaction overrides queryOne method to pass the existing
connection instead of creating a new one, but from you exploration it seems
the overridden method is not called, instead the connection calls original
queryOne and creates a new low-level connection.

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

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to