On Tue, Jan 16, 2007 at 05:46:46AM +0100, Daniel Nogradi wrote:
> I'm sure it's a noobish question, but when are connections opened and
> closed exactly?
Exactly: they are opened and closed in dbconnection.py, in class DBAPI.
> ----------------------------------------------------------------------------------------------------------
> from sqlobject import *
>
> con = connectionForURI( 'sqlite:/:memory:' )
> sqlhub.processConnection = con
>
> class t( SQLObject ):
> c = StringCol( )
>
> t.createTable( )
> # now is it open?
Yes.
> t( c='1' )
> # now is it open?
Yes.
> t( c='2' )
> t( c='3' )
> t( c='4' )
> t( c='5' )
> # now is it open?
Yes.
> s = t.select( )
> for i in s:
> print i
Yes.
> # now is it open?
> print s.count( )
> # now is it open?
Yes.
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss