Set up am implicit ‘tween’ to do transaction management using the transaction package. The tween will be slotted between the main Pyramid app and the Pyramid exception view handler.
For every request it handles, the tween will begin a transaction by calling transaction.begin(), and will then call the downstream handler (usually the main Pyramid application request handler) to obtain a response. When attempting to call the downstream handler:
When used as a commit veto, the logic in this function will cause the transaction to be aborted if:
Otherwise the transaction will be allowed to commit.