On Mon, Apr 13, 2009 at 09:51:47AM +0200, Iwan Vosloo wrote:
> On Wed, 2009-04-08 at 00:40 +0400, Oleg Broytmann wrote:
> > On Mon, Mar 30, 2009 at 04:16:16PM +0200, Iwan Vosloo wrote:
> > > This looks like a bug - correct me if I'm wrong.  Transaction.close()
> > > does not close the underlying connection. Seems like the __getattr__ of
> > > Transaction is to blame if I understand correctly.
> > 
> >    I think .close() on a Transaction must be forbidden. I am going to add a
> > .close() method to Transaction that raises an exception saying "Do not call
> > close() - call either commit(), commit(close=True) or rollback()". Ok?
> 
> Sounds good to me Oleg.  
> 
> Only thing is that if one is familiar with the DBAPI, one intuitively
> expects a sqlobject Transaction so work like a DBAPI Connection (or is
> it just me?).  If so, you sortof expect it to have .commit and .close
> methods.
> 
> But having it complain with a nice error message like that make the
> difference with the DBAPI explicit.  Which is also good.

   Calling .close() on a transaction instance means the user has messed up
connections and transaction instances so I decided the exception is
TypeError. Revisions 3856-3858. Thank you!

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

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to