From: Oleg B. <ph...@ph...> - 2009-04-17 17:12:53
|
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/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |