{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/35039489","id":35039489,"diff_hunk":"@@ -792,3 +792,89 @@ LmJavaExceptionReporter::reportInternalSPJException(LmHandle jt,\n \n }\n // LCOV_EXCL_STOP\n+\n+//\n+// reportJavaObjException(): populates the diags for\n+// a return status returned in an LmUDRObjMethodInvoke.ReturnInfo\n+// object used in the Java object interface\n+void\n+LmJavaExceptionReporter::processJavaObjException(\n+     LmHandle returnInfoObj,\n+     int returnStatus,\n+     int callPhase,\n+     const char *errText,\n+     const char *udrName,\n+     ComDiagsArea *da)\n+{\n+  if (da)\n+    {\n+      JNIEnv *jni = (JNIEnv*)jniEnv_;\n+      const char *sqlState = NULL;\n+      const char *message = NULL;\n+      jobject jniResult = (jobject) returnInfoObj;\n+      jstring returnedSQLState =\n+        static_cast<jstring>(jni->GetObjectField(\n+           jniResult, \n+           (jfieldID) langMan_->getReturnInfoSQLStateField()));\n+      jstring returnedMessage =\n+        static_cast<jstring>(jni->GetObjectField(\n+           jniResult, \n+           (jfieldID) langMan_->getReturnInfoMessageField()));\n+\n+      if (returnedSQLState != NULL)\n+        sqlState = jni->GetStringUTFChars(returnedSQLState, NULL);\n+      if (returnedMessage != NULL)\n+        message = jni->GetStringUTFChars(returnedMessage, NULL);\n+\n+      if (sqlState || message)\n+        {\n+          const char *diagsMessage =\n+            (message ? message : \"no message provided\");\n+          const char *diagsSQLState =\n+            (sqlState ? sqlState : \"no SQLSTATE provided\");\n+\n+          // Check the returned SQLSTATE value and raise appropriate\n+          // SQL code. Valid SQLSTATE values begin with \"38\" except \"38000\"\n+          if (sqlState &&\n+              (strncmp(diagsSQLState, \"38\", 2) == 0) &&\n+              (strncmp(diagsSQLState, \"38000\", 5) != 0))\n+            {\n+              *da << DgSqlCode(-LME_CUSTOM_ERROR)\n+                  << DgString0(diagsMessage)\n+                  << DgString1(diagsSQLState);\n+              *da << DgCustomSQLState(diagsSQLState);\n+            }\n+          else\n+            {\n+              *da << DgSqlCode(-LME_UDF_ERROR)\n+                  << DgString0(udrName)\n+                  << DgString1(diagsSQLState)\n+                  << DgString2(diagsMessage);\n+            }\n+        }\n+      else\n+        {\n+          // Report the return status as an internal error, since\n+          // we didn't get a UDRException. This should be rare, since\n+          // Java exceptions are caught above.\n+          char buf1[4];\n+          snprintf(buf1, sizeof(buf1), \"%d\", callPhase);\n+          char buf2[80];\n+          snprintf(buf2, sizeof(buf2), \"Return status %d from JNI call\", returnStatus);","path":"core/sql/langman/LmJavaExceptionReporter.cpp","position":72,"original_position":72,"commit_id":"44d5278c3dcd9dc7e795eee4b88607fd4459e667","original_commit_id":"44d5278c3dcd9dc7e795eee4b88607fd4459e667","user":{"login":"zellerh","id":7062636,"avatar_url":"https://avatars.githubusercontent.com/u/7062636?v=3","gravatar_id":"","url":"https://api.github.com/users/zellerh","html_url":"https://github.com/zellerh","followers_url":"https://api.github.com/users/zellerh/followers","following_url":"https://api.github.com/users/zellerh/following{/other_user}","gists_url":"https://api.github.com/users/zellerh/gists{/gist_id}","starred_url":"https://api.github.com/users/zellerh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zellerh/subscriptions","organizations_url":"https://api.github.com/users/zellerh/orgs","repos_url":"https://api.github.com/users/zellerh/repos","events_url":"https://api.github.com/users/zellerh/events{/privacy}","received_events_url":"https://api.github.com/users/zellerh/received_events","type":"User","site_admin":false},"body":"Yes, sorry, there is some English text here, but I think this particular error message goes through significant trouble to allow translation into other languages. The message text is this: Internal error in communicating with UDR $0~String0 through the object interface in the $1~String1 phase ($2~String2). Details: $3~String3.","created_at":"2015-07-20T20:25:46Z","updated_at":"2015-07-20T20:25:46Z","html_url":"https://github.com/apache/incubator-trafodion/pull/31#discussion_r35039489","pull_request_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/35039489"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/31#discussion_r35039489"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31","id":40296218,"html_url":"https://github.com/apache/incubator-trafodion/pull/31","diff_url":"https://github.com/apache/incubator-trafodion/pull/31.diff","patch_url":"https://github.com/apache/incubator-trafodion/pull/31.patch","issue_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/31","number":31,"state":"open","locked":false,"title":"TRAFODION-38 First working TMUDFs in Java","user":{"login":"zellerh","id":7062636,"avatar_url":"https://avatars.githubusercontent.com/u/7062636?v=3","gravatar_id":"","url":"https://api.github.com/users/zellerh","html_url":"https://github.com/zellerh","followers_url":"https://api.github.com/users/zellerh/followers","following_url":"https://api.github.com/users/zellerh/following{/other_user}","gists_url":"https://api.github.com/users/zellerh/gists{/gist_id}","starred_url":"https://api.github.com/users/zellerh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zellerh/subscriptions","organizations_url":"https://api.github.com/users/zellerh/orgs","repos_url":"https://api.github.com/users/zellerh/repos","events_url":"https://api.github.com/users/zellerh/events{/privacy}","received_events_url":"https://api.github.com/users/zellerh/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-18T18:23:01Z","updated_at":"2015-07-20T20:25:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83e104f80208100f231127de44df61cc1ea16bec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/31/comments","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/44d5278c3dcd9dc7e795eee4b88607fd4459e667","head":{"label":"zellerh:bug/udf1","ref":"bug/udf1","sha":"44d5278c3dcd9dc7e795eee4b88607fd4459e667","user":{"login":"zellerh","id":7062636,"avatar_url":"https://avatars.githubusercontent.com/u/7062636?v=3","gravatar_id":"","url":"https://api.github.com/users/zellerh","html_url":"https://github.com/zellerh","followers_url":"https://api.github.com/users/zellerh/followers","following_url":"https://api.github.com/users/zellerh/following{/other_user}","gists_url":"https://api.github.com/users/zellerh/gists{/gist_id}","starred_url":"https://api.github.com/users/zellerh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zellerh/subscriptions","organizations_url":"https://api.github.com/users/zellerh/orgs","repos_url":"https://api.github.com/users/zellerh/repos","events_url":"https://api.github.com/users/zellerh/events{/privacy}","received_events_url":"https://api.github.com/users/zellerh/received_events","type":"User","site_admin":false},"repo":{"id":37876449,"name":"incubator-trafodion","full_name":"zellerh/incubator-trafodion","owner":{"login":"zellerh","id":7062636,"avatar_url":"https://avatars.githubusercontent.com/u/7062636?v=3","gravatar_id":"","url":"https://api.github.com/users/zellerh","html_url":"https://github.com/zellerh","followers_url":"https://api.github.com/users/zellerh/followers","following_url":"https://api.github.com/users/zellerh/following{/other_user}","gists_url":"https://api.github.com/users/zellerh/gists{/gist_id}","starred_url":"https://api.github.com/users/zellerh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zellerh/subscriptions","organizations_url":"https://api.github.com/users/zellerh/orgs","repos_url":"https://api.github.com/users/zellerh/repos","events_url":"https://api.github.com/users/zellerh/events{/privacy}","received_events_url":"https://api.github.com/users/zellerh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zellerh/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":true,"url":"https://api.github.com/repos/zellerh/incubator-trafodion","forks_url":"https://api.github.com/repos/zellerh/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/zellerh/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zellerh/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zellerh/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/zellerh/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/zellerh/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/zellerh/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/zellerh/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/zellerh/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/zellerh/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/zellerh/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zellerh/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zellerh/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/zellerh/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zellerh/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/zellerh/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/zellerh/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/zellerh/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/zellerh/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/zellerh/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/zellerh/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/zellerh/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/zellerh/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/zellerh/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/zellerh/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/zellerh/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zellerh/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/zellerh/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zellerh/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/zellerh/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/zellerh/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/zellerh/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/zellerh/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zellerh/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/zellerh/incubator-trafodion/releases{/id}","created_at":"2015-06-22T19:35:24Z","updated_at":"2015-06-22T19:36:03Z","pushed_at":"2015-07-18T18:19:29Z","git_url":"git://github.com/zellerh/incubator-trafodion.git","ssh_url":"git@github.com:zellerh/incubator-trafodion.git","clone_url":"https://github.com/zellerh/incubator-trafodion.git","svn_url":"https://github.com/zellerh/incubator-trafodion","homepage":null,"size":51014,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"ee138980d365e01b7f48f82b76c3a06e5445990d","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":36349344,"name":"incubator-trafodion","full_name":"apache/incubator-trafodion","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/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-trafodion","forks_url":"https://api.github.com/repos/apache/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/apache/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/apache/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/apache/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/apache/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/apache/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/apache/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-trafodion/releases{/id}","created_at":"2015-05-27T07:00:05Z","updated_at":"2015-07-14T13:00:50Z","pushed_at":"2015-07-20T07:52:31Z","git_url":"git://github.com/apache/incubator-trafodion.git","ssh_url":"git@github.com:apache/incubator-trafodion.git","clone_url":"https://github.com/apache/incubator-trafodion.git","svn_url":"https://github.com/apache/incubator-trafodion","homepage":null,"size":53733,"stargazers_count":5,"watchers_count":5,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":"git://git.apache.org/incubator-trafodion.git","open_issues_count":2,"forks":33,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/31"},"issue":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/31"},"comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-trafodion/statuses/44d5278c3dcd9dc7e795eee4b88607fd4459e667"}}}}