Hey folks, I want to warn the community about an upcoming change to
pyramid_tm that has been a long time in the making. I'm excited about it -
but I also don't want to blindside anyone with a large-ish backward
incompatible change.

TLDR - You may want to pin 'pyramid_tm < 2.0' until you have a chance to
understand the changes.

There have been 3 major issues with pyramid_tm since its inception:

1) pyramid_tm doesn't cover exception view code so anything you do in an
exception view should not be touching transactional objects or performing
create / update / delete (non-readonly) queries.

2) Retry support has never fully torn down the request so if you're storing
any transactional data in a request property (like request.user) and you
have tm.attempts > 1, you may be leaking objects across transactions
leading to subtle issues.

3) There is lots of room for subtle bugs when you perform changes to a
transaction outside of the scope of pyramid_tm (it only covers part of the
request lifecycle).

The resolution of these issues has involved several steps including a new
library, a new concept in pyramid and changes to the transaction library
and pyramid_tm.

1) The pyramid_tm tween was moved in the tween hierarchy to be OVER the
EXCVIEW tween meaning transactions are kept alive during exception views
and aborted later.

2) The retry support in pyramid_tm was removed and a new library was
created called pyramid_retry. This library only works with pyramid 1.9
which is unreleased. The new retry library can will create a new request
object for every attempt, throwing away any transactional state stored on
it, leading to cleaner retries.

3) The transaction package now supports explicit transaction managers which
will error when they are used after a commit/abort. You should use one by
defining a "tm.manager_hook" that returns
"transaction.TransactionManager(explicit=True)".

I hope this was helpful. We are still reviewing the changes to pyramid_tm
and 2.0 does not have a release date but let's say that I promise it won't
happen before March 15. Once that goes live you won't have any retry
support, if you're relying on it (but I doubt you are because of the issues
above) until pyramid 1.9 which also does not have a release date. :-)

Thanks!

- Michael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwEngaXn-%3DQZe13oKgw81_XRUJn-AN_3S_NPOipNgxsG-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to