{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/2810","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/2810/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/2810/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/2810/events","html_url":"https://github.com/sequelize/sequelize/pull/2810","id":53155484,"number":2810,"title":"CLS support in transactions","user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sequelize/sequelize/labels/documentation","name":"documentation","color":"bfdadc"},{"url":"https://api.github.com/repos/sequelize/sequelize/labels/pr","name":"pr","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/sequelize/sequelize/milestones/17","labels_url":"https://api.github.com/repos/sequelize/sequelize/milestones/17/labels","id":797782,"number":17,"title":"2.0.0 final release","description":"","creator":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":34,"state":"open","created_at":"2014-09-22T06:21:20Z","updated_at":"2015-01-03T22:15:15Z","due_on":"2016-01-09T23:00:00Z","closed_at":null},"comments":7,"created_at":"2014-12-30T23:16:40Z","updated_at":"2015-01-05T15:51:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/2810","html_url":"https://github.com/sequelize/sequelize/pull/2810","diff_url":"https://github.com/sequelize/sequelize/pull/2810.diff","patch_url":"https://github.com/sequelize/sequelize/pull/2810.patch"},"body":"This PR adds support for automagically passing the current transaction to all queries within the callback passed to sequelize.transaction. For example:\r\n\r\n```js\r\nsequelize.transaction(function (t) {\r\n  // Normally you'd have to pass { transaction: t }, but CLS handles that automagically\r\n  User.find(where); \r\n\r\n  // To disable automatic passing, pass another transaction, or null for no transaction\r\n  User.find(where, { transaction: t2 });\r\n  User.find(where, { transaction: null });\r\n});\r\n```\r\n\r\nThis is still WIP - I'd like to add docs in this PR as well\r\n\r\nAdresses https://github.com/sequelize/sequelize/issues/2717 and \r\n\r\nCloses https://github.com/sequelize/sequelize/issues/1627"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/68726837","html_url":"https://github.com/sequelize/sequelize/pull/2810#issuecomment-68726837","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/2810","id":68726837,"user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T15:51:20Z","updated_at":"2015-01-05T15:51:20Z","body":"This looks really great, CLS is a great project and having that type of transaction magic makes a lot of sense - As long as it's working 100% and not leaking there's really hardly any reason why you wouldn't want any of the calls inside the transaction code block to not be in the transaction, and likely save a lot of people some headaches when forgetting `transaction: t`"}}