GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Currently the session.begin_nested() and session.commit() pattern does not work.
This allows using subtransactions. In my (limited) testing it seems to work.
Support nested sqlalchemy transactions
Merge pull request #1 from zopefoundation/master
Merge in latest zone.sqlalchemy
Apologies for the delay in getting to this.
The intended mechanism to trigger a subtransaction with zope.sqlalchemy is to use transaction.savepoint(). This ensures that other data managers participating in the transaction will also have their data rolled back to the same point.
Clearly that won't work when integrating existing code that uses session.begin_nested(), so I think this would be best to make this an option like keep_session. We'll also need a test for this feature.
On reconsidering, adding additional configuration around this isn't really warranted.