{"action":"created","comment":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/50624900","id":50624900,"diff_hunk":"@@ -129,6 +129,20 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {\n     ).to.eventually.be.rejected;\n   });\n \n+  it('does not allow queries immediatly after commit call', function() {\n+    var self = this;\n+    return expect(\n+      this.sequelize.transaction().then(function(t) {\n+        return self.sequelize.query('SELECT 1+1', {transaction: t, raw: true}).then(function() {\n+          return Promise.join(\n+            expect(t.commit()).to.eventually.be.fulfilled,\n+            expect(self.sequelize.query('SELECT 1+1', {transaction: t, raw: true})).to.eventually.be.rejectedWith(/commit has been called on this transaction\\([^)]+\\), you can no longer use it/)\n+          );\n+        });\n+      })\n+    ).to.be.eventually.fulfilled;","path":"test/integration/transaction.test.js","position":15,"original_position":15,"commit_id":"66b2073614958facfd64ab27e985400d9ddee18f","original_commit_id":"66b2073614958facfd64ab27e985400d9ddee18f","user":{"login":"ajfranzoia","id":964115,"avatar_url":"https://avatars.githubusercontent.com/u/964115?v=3","gravatar_id":"","url":"https://api.github.com/users/ajfranzoia","html_url":"https://github.com/ajfranzoia","followers_url":"https://api.github.com/users/ajfranzoia/followers","following_url":"https://api.github.com/users/ajfranzoia/following{/other_user}","gists_url":"https://api.github.com/users/ajfranzoia/gists{/gist_id}","starred_url":"https://api.github.com/users/ajfranzoia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajfranzoia/subscriptions","organizations_url":"https://api.github.com/users/ajfranzoia/orgs","repos_url":"https://api.github.com/users/ajfranzoia/repos","events_url":"https://api.github.com/users/ajfranzoia/events{/privacy}","received_events_url":"https://api.github.com/users/ajfranzoia/received_events","type":"User","site_admin":false},"body":"I had to use this style for assertions because not using the ```expect()``` wrapping inside ```Promise.join(...)``` causes the query to be rejected before the rollback/commit query is finished (since we're using an immediate call after). Thus, this prevents getting the 'There are still running queries' error thrown by ```sequelize.test.verifyNoRunningQueries()``` in ```afterEach()``` callback.\r\nI utilized this approach following the suggestion on http://chaijs.com/plugins/chai-as-promised (see 'Multiple Promise Assertions' section).","created_at":"2016-01-23T20:07:57Z","updated_at":"2016-01-23T20:07:57Z","html_url":"https://github.com/sequelize/sequelize/pull/5243#discussion_r50624900","pull_request_url":"https://api.github.com/repos/sequelize/sequelize/pulls/5243","_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/50624900"},"html":{"href":"https://github.com/sequelize/sequelize/pull/5243#discussion_r50624900"},"pull_request":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/5243"}}},"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/5243","id":56287144,"html_url":"https://github.com/sequelize/sequelize/pull/5243","diff_url":"https://github.com/sequelize/sequelize/pull/5243.diff","patch_url":"https://github.com/sequelize/sequelize/pull/5243.patch","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/5243","number":5243,"state":"open","locked":false,"title":"Fix #5222: prevent race condition after transaction finished","user":{"login":"ajfranzoia","id":964115,"avatar_url":"https://avatars.githubusercontent.com/u/964115?v=3","gravatar_id":"","url":"https://api.github.com/users/ajfranzoia","html_url":"https://github.com/ajfranzoia","followers_url":"https://api.github.com/users/ajfranzoia/followers","following_url":"https://api.github.com/users/ajfranzoia/following{/other_user}","gists_url":"https://api.github.com/users/ajfranzoia/gists{/gist_id}","starred_url":"https://api.github.com/users/ajfranzoia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajfranzoia/subscriptions","organizations_url":"https://api.github.com/users/ajfranzoia/orgs","repos_url":"https://api.github.com/users/ajfranzoia/repos","events_url":"https://api.github.com/users/ajfranzoia/events{/privacy}","received_events_url":"https://api.github.com/users/ajfranzoia/received_events","type":"User","site_admin":false},"body":"Fixes issue #5222. \r\nMoves ```transaction.finished = 'rollback'``` assignment to ```QueryInterface.rollbackTransaction()``` after rollback query call.","created_at":"2016-01-17T20:56:15Z","updated_at":"2016-01-23T20:07:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7bcba5530cc2c80e9d2de52c31d23379e31b8c8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sequelize/sequelize/pulls/5243/commits","review_comments_url":"https://api.github.com/repos/sequelize/sequelize/pulls/5243/comments","review_comment_url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/5243/comments","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/66b2073614958facfd64ab27e985400d9ddee18f","head":{"label":"ajfranzoia:fix-transaction-finished-race-condition","ref":"fix-transaction-finished-race-condition","sha":"66b2073614958facfd64ab27e985400d9ddee18f","user":{"login":"ajfranzoia","id":964115,"avatar_url":"https://avatars.githubusercontent.com/u/964115?v=3","gravatar_id":"","url":"https://api.github.com/users/ajfranzoia","html_url":"https://github.com/ajfranzoia","followers_url":"https://api.github.com/users/ajfranzoia/followers","following_url":"https://api.github.com/users/ajfranzoia/following{/other_user}","gists_url":"https://api.github.com/users/ajfranzoia/gists{/gist_id}","starred_url":"https://api.github.com/users/ajfranzoia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajfranzoia/subscriptions","organizations_url":"https://api.github.com/users/ajfranzoia/orgs","repos_url":"https://api.github.com/users/ajfranzoia/repos","events_url":"https://api.github.com/users/ajfranzoia/events{/privacy}","received_events_url":"https://api.github.com/users/ajfranzoia/received_events","type":"User","site_admin":false},"repo":{"id":43705948,"name":"sequelize","full_name":"ajfranzoia/sequelize","owner":{"login":"ajfranzoia","id":964115,"avatar_url":"https://avatars.githubusercontent.com/u/964115?v=3","gravatar_id":"","url":"https://api.github.com/users/ajfranzoia","html_url":"https://github.com/ajfranzoia","followers_url":"https://api.github.com/users/ajfranzoia/followers","following_url":"https://api.github.com/users/ajfranzoia/following{/other_user}","gists_url":"https://api.github.com/users/ajfranzoia/gists{/gist_id}","starred_url":"https://api.github.com/users/ajfranzoia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajfranzoia/subscriptions","organizations_url":"https://api.github.com/users/ajfranzoia/orgs","repos_url":"https://api.github.com/users/ajfranzoia/repos","events_url":"https://api.github.com/users/ajfranzoia/events{/privacy}","received_events_url":"https://api.github.com/users/ajfranzoia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajfranzoia/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":true,"url":"https://api.github.com/repos/ajfranzoia/sequelize","forks_url":"https://api.github.com/repos/ajfranzoia/sequelize/forks","keys_url":"https://api.github.com/repos/ajfranzoia/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajfranzoia/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajfranzoia/sequelize/teams","hooks_url":"https://api.github.com/repos/ajfranzoia/sequelize/hooks","issue_events_url":"https://api.github.com/repos/ajfranzoia/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/ajfranzoia/sequelize/events","assignees_url":"https://api.github.com/repos/ajfranzoia/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/ajfranzoia/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/ajfranzoia/sequelize/tags","blobs_url":"https://api.github.com/repos/ajfranzoia/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajfranzoia/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajfranzoia/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajfranzoia/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajfranzoia/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/ajfranzoia/sequelize/languages","stargazers_url":"https://api.github.com/repos/ajfranzoia/sequelize/stargazers","contributors_url":"https://api.github.com/repos/ajfranzoia/sequelize/contributors","subscribers_url":"https://api.github.com/repos/ajfranzoia/sequelize/subscribers","subscription_url":"https://api.github.com/repos/ajfranzoia/sequelize/subscription","commits_url":"https://api.github.com/repos/ajfranzoia/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajfranzoia/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajfranzoia/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajfranzoia/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajfranzoia/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/ajfranzoia/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajfranzoia/sequelize/merges","archive_url":"https://api.github.com/repos/ajfranzoia/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajfranzoia/sequelize/downloads","issues_url":"https://api.github.com/repos/ajfranzoia/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/ajfranzoia/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/ajfranzoia/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/ajfranzoia/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajfranzoia/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/ajfranzoia/sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/ajfranzoia/sequelize/deployments","created_at":"2015-10-05T18:44:48Z","updated_at":"2015-10-05T18:44:52Z","pushed_at":"2016-01-23T19:39:40Z","git_url":"git://github.com/ajfranzoia/sequelize.git","ssh_url":"git@github.com:ajfranzoia/sequelize.git","clone_url":"https://github.com/ajfranzoia/sequelize.git","svn_url":"https://github.com/ajfranzoia/sequelize","homepage":"http://sequelizejs.com","size":16889,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sequelize:master","ref":"master","sha":"7330ad8be57c5b39817126adfb2f8590c3083e2d","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/sequelize/sequelize/deployments","created_at":"2010-07-22T07:11:11Z","updated_at":"2016-01-23T18:44:32Z","pushed_at":"2016-01-23T19:39:41Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":53586,"stargazers_count":5571,"watchers_count":5571,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1198,"mirror_url":null,"open_issues_count":665,"forks":1198,"open_issues":665,"watchers":5571,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/5243"},"html":{"href":"https://github.com/sequelize/sequelize/pull/5243"},"issue":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/5243"},"comments":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/5243/comments"},"review_comments":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/5243/comments"},"review_comment":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/5243/commits"},"statuses":{"href":"https://api.github.com/repos/sequelize/sequelize/statuses/66b2073614958facfd64ab27e985400d9ddee18f"}}}}