62 messages in com.googlegroups.pylons-discussRe: Turbogears now based on Pylons!
FromSent OnAttachments
Spider27 Jun 2007 06:22 
rikl...@public.gmane.org27 Jun 2007 08:00 
Jonathan LaCour27 Jun 2007 08:10 
anderbubble27 Jun 2007 09:13 
Mark Ramm27 Jun 2007 12:39 
Mike Orr27 Jun 2007 13:45 
Mark Ramm27 Jun 2007 14:49 
Ian Bicking27 Jun 2007 14:56 
Jonathan LaCour27 Jun 2007 15:26 
Noah Gift27 Jun 2007 15:38 
Ian Bicking27 Jun 2007 15:41 
Mike Orr27 Jun 2007 15:45 
Jonathan LaCour27 Jun 2007 16:01 
Mike Orr27 Jun 2007 16:44 
Mike Orr27 Jun 2007 16:55 
Mark Ramm27 Jun 2007 17:06 
Uwe C. Schroeder27 Jun 2007 17:23 
Mike Orr27 Jun 2007 18:55 
Michael Bayer27 Jun 2007 20:46 
Michael Bayer27 Jun 2007 21:00 
Michael Bayer27 Jun 2007 21:09 
Michael Bayer27 Jun 2007 21:27 
Uwe C. Schroeder27 Jun 2007 22:40 
Mike Orr27 Jun 2007 23:09 
Mike Orr27 Jun 2007 23:40 
Uwe C. Schroeder28 Jun 2007 00:46 
Wichert Akkerman28 Jun 2007 00:54 
Mike Orr28 Jun 2007 01:33 
Uwe C. Schroeder28 Jun 2007 01:50 
Jonathan LaCour28 Jun 2007 05:55 
Jonathan LaCour28 Jun 2007 06:58 
Michael Bayer28 Jun 2007 07:12 
Michael Bayer28 Jun 2007 07:20 
Michael Bayer28 Jun 2007 07:27 
Michael Bayer28 Jun 2007 07:34 
Jonathan LaCour28 Jun 2007 07:53 
Ian Bicking28 Jun 2007 08:45 
Michael Bayer28 Jun 2007 09:31 
Cliff Wells28 Jun 2007 09:35 
Alberto Valverde28 Jun 2007 10:16 
Alberto Valverde28 Jun 2007 10:29 
Jonathan LaCour28 Jun 2007 10:32 
Ian Bicking28 Jun 2007 10:45 
Alberto Valverde28 Jun 2007 11:01 
Alberto Valverde28 Jun 2007 11:15 
Uwe C. Schroeder28 Jun 2007 11:32 
Mike Orr28 Jun 2007 11:52 
Alberto Valverde28 Jun 2007 11:58 
Noah Gift28 Jun 2007 12:02 
Jonathan LaCour28 Jun 2007 12:02 
Mike Orr28 Jun 2007 12:31 
Jonathan LaCour28 Jun 2007 12:48 
Noah Gift28 Jun 2007 15:12 
Michael Bayer28 Jun 2007 15:38 
Michael Bayer28 Jun 2007 15:42 
Noah Gift28 Jun 2007 16:41 
rikl...@public.gmane.org28 Jun 2007 17:28 
Uwe C. Schroeder28 Jun 2007 21:03 
Mike Orr28 Jun 2007 21:55 
Noah Gift29 Jun 2007 04:49 
Mike Orr29 Jun 2007 08:32 
Noah Gift29 Jun 2007 08:35 
Subject:Re: Turbogears now based on Pylons!
From:Alberto Valverde (albe@public.gmane.org)
Date:06/28/2007 10:16:54 AM
List:com.googlegroups.pylons-discuss

On Jun 28, 2007, at 3:56 AM, Mike Orr wrote:

On 6/27/07, Mark Ramm
<mark@public.gmane.org> wrote:

It sounds like Pylons and TurboGears have very different paradigms about how transactions are handled.

I can't do a side-by-side comparison, because I am not 100% clear on an example of the "right way" to handle transactions in Pylons.

But I can describe what TurboGears 1.0 does.

TG currently has an "automatic transaction per request" feature, which is very widely used.

If a request fails for any reason, at any point the exception is propigated out, and causes a transaction rollback.

The base controller's .__call__ method is your friend (but see below). Wrap the subclass call in a try-commit, You can also use the .__before__ and .__after__ methods unless you want to leave those empty for users. This avoids the need for fragile middleware and fussing with the WSGI environment.

I'd like to add here that I've got use-cases for the transaction boundary and session initialization being closer to the server than what the __before__ and __after__ hooks provide.

For example, the authentication function I feed to AuthKit which uses a DB connection to retrieve the user and it's associated roles and permissions.

I can think of other cases where other layers of middleware (more precisely, Middleware FrameWork Components) might want to access the database. Having all these layers plus the controller method (or other WSGI which sit below PylonsWSGIApp) wrapped in the same transaction sounds like a good idea to me.

Alberto