{"action":"created","issue":{"url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/14","labels_url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/14/comments","events_url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/14/events","html_url":"https://github.com/zopefoundation/zope.sqlalchemy/issues/14","id":108173650,"number":14,"title":"No session.rollback() when transaction.abort() is called.","user":{"login":"groner","id":47317,"avatar_url":"https://avatars.githubusercontent.com/u/47317?v=3","gravatar_id":"","url":"https://api.github.com/users/groner","html_url":"https://github.com/groner","followers_url":"https://api.github.com/users/groner/followers","following_url":"https://api.github.com/users/groner/following{/other_user}","gists_url":"https://api.github.com/users/groner/gists{/gist_id}","starred_url":"https://api.github.com/users/groner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groner/subscriptions","organizations_url":"https://api.github.com/users/groner/orgs","repos_url":"https://api.github.com/users/groner/repos","events_url":"https://api.github.com/users/groner/events{/privacy}","received_events_url":"https://api.github.com/users/groner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-24T17:12:41Z","updated_at":"2015-09-24T20:43:19Z","closed_at":"2015-09-24T20:43:18Z","body":"When the default setting of `keep_session=False` is used this isn't an issue, because the connection pool will reset the connection before it is used again.  It seems like the session would need to be rolled back when `keep_session=True` is used.\r\n\r\nI see that the two phase data manager issues a rollback in `tpc_abort()`.\r\n\r\nIs this (`keep_session=True, twophase=True`) just a configuration that nobody uses (perhaps for some reason I've overlooked)?"},"comment":{"url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/comments/143045355","html_url":"https://github.com/zopefoundation/zope.sqlalchemy/issues/14#issuecomment-143045355","issue_url":"https://api.github.com/repos/zopefoundation/zope.sqlalchemy/issues/14","id":143045355,"user":{"login":"lrowe","id":290859,"avatar_url":"https://avatars.githubusercontent.com/u/290859?v=3","gravatar_id":"","url":"https://api.github.com/users/lrowe","html_url":"https://github.com/lrowe","followers_url":"https://api.github.com/users/lrowe/followers","following_url":"https://api.github.com/users/lrowe/following{/other_user}","gists_url":"https://api.github.com/users/lrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/lrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrowe/subscriptions","organizations_url":"https://api.github.com/users/lrowe/orgs","repos_url":"https://api.github.com/users/lrowe/repos","events_url":"https://api.github.com/users/lrowe/events{/privacy}","received_events_url":"https://api.github.com/users/lrowe/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T20:43:18Z","updated_at":"2015-09-24T20:43:18Z","body":"> I see. I already have another mechanism to make sure the session gets closed, so keep_session looked like the way to go. I suppose there's no reason I can't let the transaction manager handle it though.\r\n\r\nIf you have special requirements for the session lifecycle then zope.sqlalchemy may not be appropriate for your use case.\r\n\r\n> This makes sense, but shouldn't rollback be called any time the transaction is aborted?\r\n\r\nSession rollback happens as a side effect to closing the session, so the data manager does not call it directly."}}