{"action":"created","comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/comments/108460055","pull_request_review_id":29491956,"id":108460055,"diff_hunk":"@@ -23,19 +31,29 @@ public Task<CompletableSynchronizedStorageSession> TryAdapt(OutboxTransaction tr\n             CompletableSynchronizedStorageSession session = new StorageSession(outboxTransaction.Connection, outboxTransaction.Transaction, false, infoCache);\n             return Task.FromResult(session);\n         }\n-        return EmptyResult;\n+        return EmptyResultTask;\n     }\n \n-    public Task<CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context)\n+    public async Task<CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context)\n     {\n         SqlConnection existingSqlConnection;\n         SqlTransaction existingSqlTransaction;\n         //SQL server transport in native TX mode\n         if (transportTransaction.TryGet(out existingSqlConnection) && transportTransaction.TryGet(out existingSqlTransaction))\n         {\n             CompletableSynchronizedStorageSession session = new StorageSession(existingSqlConnection, existingSqlTransaction, false, infoCache);\n-            return Task.FromResult(session);\n+            return session;\n         }\n+\n+        Transaction existingTransaction;\n+        // Transport supports DTC and uses TxScope owned by the transport\n+        if (transportTransaction.TryGet(out existingTransaction))","path":"src/SqlPersistence/SynchronizedStorage/StorageAdapter.cs","position":51,"original_position":51,"commit_id":"8891abe11f234a57a778c886ef335a327ddf844a","original_commit_id":"8891abe11f234a57a778c886ef335a327ddf844a","user":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars2.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"body":"I think it should be fairly safe to do it this way since only SQL will add the connection and native tx to the transport transaction which should take precedence over this check here. Thoughts?","created_at":"2017-03-28T15:48:20Z","updated_at":"2017-03-28T15:48:21Z","html_url":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75#discussion_r108460055","pull_request_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75","_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/comments/108460055"},"html":{"href":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75#discussion_r108460055"},"pull_request":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75"}}},"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75","id":113003206,"html_url":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75","diff_url":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75.diff","patch_url":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75.patch","issue_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/75","number":75,"state":"open","locked":false,"title":"Storage adapter adapts to ambient transaction if present","user":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars2.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"body":"Closes #74","created_at":"2017-03-28T15:45:59Z","updated_at":"2017-03-28T15:48:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d99f839fb52022f75e62d496c35bbb74e444fe46","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75/commits","review_comments_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75/comments","review_comment_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/75/comments","statuses_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/statuses/8891abe11f234a57a778c886ef335a327ddf844a","head":{"label":"danielmarbach:storage-adapter-ambient-tx","ref":"storage-adapter-ambient-tx","sha":"8891abe11f234a57a778c886ef335a327ddf844a","user":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars2.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"repo":{"id":80400789,"name":"NServiceBus.SqlPersistence","full_name":"danielmarbach/NServiceBus.SqlPersistence","owner":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars2.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielmarbach/NServiceBus.SqlPersistence","description":null,"fork":true,"url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence","forks_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/forks","keys_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/teams","hooks_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/hooks","issue_events_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/issues/events{/number}","events_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/events","assignees_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/assignees{/user}","branches_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/branches{/branch}","tags_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/tags","blobs_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/statuses/{sha}","languages_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/languages","stargazers_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/stargazers","contributors_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/contributors","subscribers_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/subscribers","subscription_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/subscription","commits_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/contents/{+path}","compare_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/merges","archive_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/downloads","issues_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/issues{/number}","pulls_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/pulls{/number}","milestones_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/milestones{/number}","notifications_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/labels{/name}","releases_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/releases{/id}","deployments_url":"https://api.github.com/repos/danielmarbach/NServiceBus.SqlPersistence/deployments","created_at":"2017-01-30T07:11:10Z","updated_at":"2017-01-30T07:11:13Z","pushed_at":"2017-03-28T15:38:01Z","git_url":"git://github.com/danielmarbach/NServiceBus.SqlPersistence.git","ssh_url":"git@github.com:danielmarbach/NServiceBus.SqlPersistence.git","clone_url":"https://github.com/danielmarbach/NServiceBus.SqlPersistence.git","svn_url":"https://github.com/danielmarbach/NServiceBus.SqlPersistence","homepage":null,"size":3775,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"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":"Particular:core6_2","ref":"core6_2","sha":"c00be732ec1adbe2d19081ac3627564fb2c59a19","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars3.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":42932319,"name":"NServiceBus.Persistence.Sql","full_name":"Particular/NServiceBus.Persistence.Sql","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars3.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus.Persistence.Sql","description":"Native SQL Persistence for NServiceBus","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql","forks_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/deployments","created_at":"2015-09-22T12:29:15Z","updated_at":"2017-03-16T20:37:43Z","pushed_at":"2017-03-28T15:46:00Z","git_url":"git://github.com/Particular/NServiceBus.Persistence.Sql.git","ssh_url":"git@github.com:Particular/NServiceBus.Persistence.Sql.git","clone_url":"https://github.com/Particular/NServiceBus.Persistence.Sql.git","svn_url":"https://github.com/Particular/NServiceBus.Persistence.Sql","homepage":"https://docs.particular.net/nservicebus/sql-persistence/","size":4328,"stargazers_count":4,"watchers_count":4,"language":"C#","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75"},"html":{"href":"https://github.com/Particular/NServiceBus.Persistence.Sql/pull/75"},"issue":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/75"},"comments":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/issues/75/comments"},"review_comments":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75/comments"},"review_comment":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/pulls/75/commits"},"statuses":{"href":"https://api.github.com/repos/Particular/NServiceBus.Persistence.Sql/statuses/8891abe11f234a57a778c886ef335a327ddf844a"}}}}
{"actor":{"display_login":"danielmarbach"}}