> How come you guys aren't using ZopeTransactionExtension for this , i.e.  
> http://docs.pylonsproject.org/projects/pyramid/en/1.2-branch/tutorials/wiki2/basiclayout.html#content-models-with-models-py?
>    My understanding is that session scope should be entirely handled in 
> that case.
>

I'm using a non-global session setup, similar to what's described here: 
http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/sqla.html#using-a-non-global-session,
 
and the code above seemed like the simplest way to ensure the session gets 
closed without adding another dependency.

At a glance, I don't like the idea of having to `import transaction`. That 
said, I haven't really looked at the ZopeTransactionExtension. What is the 
advantage to doing `transaction.commit|abort` vs. `session.commit|rollback`?


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/OoGyNum7zbkJ.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to