{"action":"created","issue":{"url":"https://api.github.com/repos/atk4/dsql/issues/89","repository_url":"https://api.github.com/repos/atk4/dsql","labels_url":"https://api.github.com/repos/atk4/dsql/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/atk4/dsql/issues/89/comments","events_url":"https://api.github.com/repos/atk4/dsql/issues/89/events","html_url":"https://github.com/atk4/dsql/issues/89","id":164508671,"number":89,"title":"rolling back nested tranactions","user":{"login":"romaninsh","id":453929,"avatar_url":"https://avatars.githubusercontent.com/u/453929?v=3","gravatar_id":"","url":"https://api.github.com/users/romaninsh","html_url":"https://github.com/romaninsh","followers_url":"https://api.github.com/users/romaninsh/followers","following_url":"https://api.github.com/users/romaninsh/following{/other_user}","gists_url":"https://api.github.com/users/romaninsh/gists{/gist_id}","starred_url":"https://api.github.com/users/romaninsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaninsh/subscriptions","organizations_url":"https://api.github.com/users/romaninsh/orgs","repos_url":"https://api.github.com/users/romaninsh/repos","events_url":"https://api.github.com/users/romaninsh/events{/privacy}","received_events_url":"https://api.github.com/users/romaninsh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-08T11:07:11Z","updated_at":"2016-07-08T14:35:44Z","closed_at":null,"body":"Question: suppose you have a transaction that adds a new user, that performs multiple operations in DB. This operation calls another routine that adds a new bank account, which also uses a transaction for multiple operations.\r\n\r\nNow suppose bank transaction addition operation fails some checks and you want to roll it back. Unfortunately you can't because SQL does not support multiple BEGIN TRANSACTIONS. So the code should somehow throw an exception but I'm not sure how."},"comment":{"url":"https://api.github.com/repos/atk4/dsql/issues/comments/231376206","html_url":"https://github.com/atk4/dsql/issues/89#issuecomment-231376206","issue_url":"https://api.github.com/repos/atk4/dsql/issues/89","id":231376206,"user":{"login":"romaninsh","id":453929,"avatar_url":"https://avatars.githubusercontent.com/u/453929?v=3","gravatar_id":"","url":"https://api.github.com/users/romaninsh","html_url":"https://github.com/romaninsh","followers_url":"https://api.github.com/users/romaninsh/followers","following_url":"https://api.github.com/users/romaninsh/following{/other_user}","gists_url":"https://api.github.com/users/romaninsh/gists{/gist_id}","starred_url":"https://api.github.com/users/romaninsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaninsh/subscriptions","organizations_url":"https://api.github.com/users/romaninsh/orgs","repos_url":"https://api.github.com/users/romaninsh/repos","events_url":"https://api.github.com/users/romaninsh/events{/privacy}","received_events_url":"https://api.github.com/users/romaninsh/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T14:35:43Z","updated_at":"2016-07-08T14:35:43Z","body":"I propose the following solution:\r\n\r\n - when rollback happens inside a deep level , set a flag \r\n - once we're to the top-level if rollback is called (which should), clear flag and perform a rollback.\r\n - otherwise, if the commit is called, rollback anyway and throw an exception, because there is logic in the code."}}
{"actor":{"display_login":"romaninsh"}}