{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/1484","repository_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/1484/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/1484/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/1484","id":254290241,"number":1484,"title":"Part 1 of moving tx timeout and id to connector","user":{"login":"lehni","id":213275,"avatar_url":"https://avatars3.githubusercontent.com/u/213275?v=4","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"labels":[{"id":640670920,"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/labels/team-apex","name":"team-apex","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":{"login":"kjdelisle","id":2053534,"avatar_url":"https://avatars3.githubusercontent.com/u/2053534?v=4","gravatar_id":"","url":"https://api.github.com/users/kjdelisle","html_url":"https://github.com/kjdelisle","followers_url":"https://api.github.com/users/kjdelisle/followers","following_url":"https://api.github.com/users/kjdelisle/following{/other_user}","gists_url":"https://api.github.com/users/kjdelisle/gists{/gist_id}","starred_url":"https://api.github.com/users/kjdelisle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjdelisle/subscriptions","organizations_url":"https://api.github.com/users/kjdelisle/orgs","repos_url":"https://api.github.com/users/kjdelisle/repos","events_url":"https://api.github.com/users/kjdelisle/events{/privacy}","received_events_url":"https://api.github.com/users/kjdelisle/received_events","type":"User","site_admin":false},"assignees":[{"login":"kjdelisle","id":2053534,"avatar_url":"https://avatars3.githubusercontent.com/u/2053534?v=4","gravatar_id":"","url":"https://api.github.com/users/kjdelisle","html_url":"https://github.com/kjdelisle","followers_url":"https://api.github.com/users/kjdelisle/followers","following_url":"https://api.github.com/users/kjdelisle/following{/other_user}","gists_url":"https://api.github.com/users/kjdelisle/gists{/gist_id}","starred_url":"https://api.github.com/users/kjdelisle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjdelisle/subscriptions","organizations_url":"https://api.github.com/users/kjdelisle/orgs","repos_url":"https://api.github.com/users/kjdelisle/repos","events_url":"https://api.github.com/users/kjdelisle/events{/privacy}","received_events_url":"https://api.github.com/users/kjdelisle/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2017-08-31T10:35:39Z","updated_at":"2017-09-26T19:01:28Z","closed_at":"2017-08-31T15:10:17Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/1484","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/1484","diff_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/1484.diff","patch_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/1484.patch"},"body":"### Description\r\n\r\nThis simple PR is part one of moving the handling of transaction timeouts and ids from `loopback-datasource-juggler`'s [`TransactionMixin.beginTransaction()`](https://github.com/strongloop/loopback-datasource-juggler/blob/3b45c76d0fd3364c55a55720d685b5596fb578d1/lib/transaction.js#L73-L108) to `loopback-connector`'s [`Transaction.begin()`](https://github.com/strongloop/loopback-connector/blob/fd7d5db2c88295ed695162d906220f722a628293/lib/transaction.js#L66-L99), where it makes more sense and can be leveraged more easily by other parts of the code, e.g. the work I am doing in #1472. For a more detailed description of the motivation to do so, see https://github.com/strongloop/loopback-datasource-juggler/pull/1472#issuecomment-324613756\r\n\r\nBy itself, this does not change anything yet, it just adds support for moving / (duplicating for the time being) the functionality in `loopback-connector`, without calling the `timeout` observers twice.\r\n\r\nAs the comment in this PR suggests, we should keep this code around for quite a while and eventually remove it:\r\n\r\n```js\r\n// NOTE(lehni) As part of the process of moving the handling of\r\n// transaction id and timeout from TransactionMixin.beginTransaction() to\r\n// Transaction.begin() in loopback-connector, switch to only setting id\r\n// and timeout if it wasn't taken care of already by Transaction.begin().\r\n// Eventually, we can remove the following two if-blocks altogether.\r\n```\r\n\r\nI don't think additional tests are required.\r\n\r\n#### Related issues\r\n\r\n- strongloop/loopback-connector#116\r\n- #1472\r\n\r\n### Checklist\r\n\r\n- [ ] New tests added or existing tests modified to cover all changes\r\n- [x] Code conforms with the [style guide](http://loopback.io/doc/en/contrib/style-guide.html)\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/332301610","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/1484#issuecomment-332301610","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/1484","id":332301610,"user":{"login":"kjdelisle","id":2053534,"avatar_url":"https://avatars3.githubusercontent.com/u/2053534?v=4","gravatar_id":"","url":"https://api.github.com/users/kjdelisle","html_url":"https://github.com/kjdelisle","followers_url":"https://api.github.com/users/kjdelisle/followers","following_url":"https://api.github.com/users/kjdelisle/following{/other_user}","gists_url":"https://api.github.com/users/kjdelisle/gists{/gist_id}","starred_url":"https://api.github.com/users/kjdelisle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjdelisle/subscriptions","organizations_url":"https://api.github.com/users/kjdelisle/orgs","repos_url":"https://api.github.com/users/kjdelisle/repos","events_url":"https://api.github.com/users/kjdelisle/events{/privacy}","received_events_url":"https://api.github.com/users/kjdelisle/received_events","type":"User","site_admin":false},"created_at":"2017-09-26T19:01:27Z","updated_at":"2017-09-26T19:01:27Z","author_association":"CONTRIBUTOR","body":"@lehni I'm good with the plural form (we already do it for things like `strong-tools`, so it makes sense to me).\r\nI'll create the empty repository for it and give you read/write."}}
{"actor":{"display_login":"kjdelisle"}}