On Thu, Aug 4, 2011 at 12:06 PM, Chris McDonough <[email protected]> wrote:

> > I kinda feel like there is still a larger question here, though...
> > using transaction manager, code that is executed in a view callable
> > doesn't *really* finish till after the users' function is over... so
> > there's no chance of cleaning up if the transaction fails.
>
> Actually, there is:
>
> http://www.zodb.org/zodbbook/transactions.html#after-commit-hooks


Neat, that's helpful, thanks. In critical cases, one can use this... but
it's not the usual Pyramid pattern, so the larger philosophical question
still stands, IMO: when using transactions, how all-in does one have to go?




> We actually can and do make file io transactional:
> http://docs.repoze.org/filesafe/


Also cool, but it wouldn't work for deletes, renames, etc.



> Is there an actual problem here that can't be solved by either making
> sessions transactional or by after-commit?


I am not having an "actual problem"... I had one, but it was pilot error,
and it's gone. It's more like a theoretical problem. Does that annoy you
;-)? As I grok pyramid, I'm seeing the theoretical chance to write unsafe
code when using transactions; I can internalize the possibility as I code
that a "partially" successful login event needs to be treated very
carefully. I suppose it's a side effect of repoze.tm being in the pipeline
and "magically" saving my database changes when I don't have to. Of course I
don't have to use this feature, I know...

This discussion is teasing out some things, I think:
1. Sessions should be transactional if transaction manager is on the stack.
(as you've said like 3 times now)
2. perhaps we need a cookbook entry coupled with some fancy view-callable
handler code that supports after-commit.

(Forgive me if these things are all boring done-deal items in the Zope land,
I'm not from that world.)

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to