On Sat, 2008-12-13 at 20:39 +0300, Oleg Broytmann wrote:
> On Sat, Dec 13, 2008 at 07:26:14PM +0200, Iwan Vosloo wrote:
>    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.

Self is the connection.

What happens is this line (dbconnection.py):
755             attr = getattr(self._dbConnection, attr)

is called while self is still the Transaction, for attr
'server_version'.

This returns the server_version (bound) method on the connection, and
calls that with self == the connection. Inside there is where the
self.queryOne is called:

304                 server_version = self.queryOne("SELECT version()")[0]

Maybe a simple workaround would be to implement a server_version method
on the Transaction too? (Or to just set it to a value.)

- Iwan


------------------------------------------------------------------------------
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