On Fri, Mar 16, 2007 at 01:56:49PM +0100, sophana wrote:
> Why does it have to get a new connection? Why not using the current
> thread connection, as there can't be any other request made?

   hub.getConnection() should do this. Don't know why it leaks connections.

> Ok, but you use the doInTransaction method and an exception occurs, the
> method calls rollback(). Shouldn'it release the connection to the pool also?

   .rollback() does this.

> If thread A changes in a transaction an instance value (without a
> forUpdate=True), but doesn't commit yet, and thread B access the same
> row instance (without a forUpdate=True). Isn't thread B supposed to read
> the old value of the instance?

   It is. But now when your program has grabbed an instance it is the
responsibility of the program to redraw it from the DB when another thread
updated the DB. The instance in your program is beyond SQLObject reach.

> This may be why you need to use the sqlmeta cacheValues=False in this case?

   This is a reason. cacheValues=False  makes things simpler but with the
price of speed. You can have your speed with cacheValues=True, but you have
to synchronize objects in your threads yourself. SQLObject cannot do both at
once. Either speed or convenience.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to