On Wed, Feb 03, 2010 at 01:37:08PM -1000, John Bresnahan wrote:
> 2) at what point is an object associated with a DB connection?
> 3) is it at all possible to change the DB connection associated with a given object?
Objects (SQLObject instances that correspond to rows in a table) are
seldom associated with a connection (though it is certainly possible).
SQLObject classes (that correspond to tables) are usually associated with
a connection; .setConnection() is a class method.
To associate an object with a connection you have to SELECT it via that
connection:
> trans = sqlhub.processConnection.transaction()
and now do
xfer = XferTable.get(id, connection=trans)
or XferTable.select(condition, connection=trans).
Most SQLObject methods accept 'connection' parameter.
Oleg.
--
Oleg Broytman http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|