{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/45872009","id":45872009,"diff_hunk":"@@ -125,8 +125,13 @@ object JdbcUtils extends Logging {\n       dialect: JdbcDialect): Iterator[Byte] = {\n     val conn = getConnection()\n     var committed = false\n+    var supportsTransactions = true\n     try {\n-      conn.setAutoCommit(false) // Everything in the same db transaction.\n+      supportsTransactions = conn.getMetaData().supportsDataManipulationTransactionsOnly() ||  conn.getMetaData().supportsDataDefinitionAndDataManipulationTransactions()\n+    }\n+    try {\n+      if (supportsTransactions)","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala","position":10,"original_position":10,"commit_id":"0b9ea1ae5fe16528bcfcadeaed2839343f1ce593","original_commit_id":"0b9ea1ae5fe16528bcfcadeaed2839343f1ce593","user":{"login":"srowen","id":822522,"avatar_url":"https://avatars.githubusercontent.com/u/822522?v=3","gravatar_id":"","url":"https://api.github.com/users/srowen","html_url":"https://github.com/srowen","followers_url":"https://api.github.com/users/srowen/followers","following_url":"https://api.github.com/users/srowen/following{/other_user}","gists_url":"https://api.github.com/users/srowen/gists{/gist_id}","starred_url":"https://api.github.com/users/srowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srowen/subscriptions","organizations_url":"https://api.github.com/users/srowen/orgs","repos_url":"https://api.github.com/users/srowen/repos","events_url":"https://api.github.com/users/srowen/events{/privacy}","received_events_url":"https://api.github.com/users/srowen/received_events","type":"User","site_admin":false},"body":"Needs braces","created_at":"2015-11-25T14:28:45Z","updated_at":"2015-11-25T14:28:45Z","html_url":"https://github.com/apache/spark/pull/9973#discussion_r45872009","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/9973","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/45872009"},"html":{"href":"https://github.com/apache/spark/pull/9973#discussion_r45872009"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/9973"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/9973","id":51799791,"html_url":"https://github.com/apache/spark/pull/9973","diff_url":"https://github.com/apache/spark/pull/9973.diff","patch_url":"https://github.com/apache/spark/pull/9973.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/9973","number":9973,"state":"open","locked":false,"title":"Fixes SPARK-11989  Spark JDBC write only works on techologies with transaction support","user":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"body":"Fixes [SPARK-11989](https://issues.apache.org/jira/browse/SPARK-11989)","created_at":"2015-11-25T14:22:59Z","updated_at":"2015-11-25T14:28:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1229b353830c157620130af855ac550cfb86ab44","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/9973/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/9973/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/9973/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/0b9ea1ae5fe16528bcfcadeaed2839343f1ce593","head":{"label":"CK50:branch-1.6_non-transactional","ref":"branch-1.6_non-transactional","sha":"0b9ea1ae5fe16528bcfcadeaed2839343f1ce593","user":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"repo":{"id":46780090,"name":"spark","full_name":"CK50/spark","owner":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CK50/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/CK50/spark","forks_url":"https://api.github.com/repos/CK50/spark/forks","keys_url":"https://api.github.com/repos/CK50/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CK50/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CK50/spark/teams","hooks_url":"https://api.github.com/repos/CK50/spark/hooks","issue_events_url":"https://api.github.com/repos/CK50/spark/issues/events{/number}","events_url":"https://api.github.com/repos/CK50/spark/events","assignees_url":"https://api.github.com/repos/CK50/spark/assignees{/user}","branches_url":"https://api.github.com/repos/CK50/spark/branches{/branch}","tags_url":"https://api.github.com/repos/CK50/spark/tags","blobs_url":"https://api.github.com/repos/CK50/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CK50/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CK50/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/CK50/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CK50/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/CK50/spark/languages","stargazers_url":"https://api.github.com/repos/CK50/spark/stargazers","contributors_url":"https://api.github.com/repos/CK50/spark/contributors","subscribers_url":"https://api.github.com/repos/CK50/spark/subscribers","subscription_url":"https://api.github.com/repos/CK50/spark/subscription","commits_url":"https://api.github.com/repos/CK50/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/CK50/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/CK50/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/CK50/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/CK50/spark/contents/{+path}","compare_url":"https://api.github.com/repos/CK50/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CK50/spark/merges","archive_url":"https://api.github.com/repos/CK50/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CK50/spark/downloads","issues_url":"https://api.github.com/repos/CK50/spark/issues{/number}","pulls_url":"https://api.github.com/repos/CK50/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/CK50/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/CK50/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CK50/spark/labels{/name}","releases_url":"https://api.github.com/repos/CK50/spark/releases{/id}","created_at":"2015-11-24T09:13:11Z","updated_at":"2015-11-24T12:13:26Z","pushed_at":"2015-11-24T15:53:41Z","git_url":"git://github.com/CK50/spark.git","ssh_url":"git@github.com:CK50/spark.git","clone_url":"https://github.com/CK50/spark.git","svn_url":"https://github.com/CK50/spark","homepage":null,"size":137012,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:branch-1.6","ref":"branch-1.6","sha":"4971eaaa5768ad20c5a77278e435c97409a9ca8f","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-11-25T13:27:48Z","pushed_at":"2015-11-25T14:22:59Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":386846,"stargazers_count":6342,"watchers_count":6342,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5838,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":375,"forks":5838,"open_issues":375,"watchers":6342,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/9973"},"html":{"href":"https://github.com/apache/spark/pull/9973"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/9973"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/9973/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/9973/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/9973/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/0b9ea1ae5fe16528bcfcadeaed2839343f1ce593"}}}}