[ 
https://issues.apache.org/jira/browse/TRAFODION-1988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15730099#comment-15730099
 ] 

ASF GitHub Bot commented on TRAFODION-1988:
-------------------------------------------

Github user selvaganesang commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/861#discussion_r91400045
  
    --- Diff: core/sqf/src/seatrans/tm/hbasetmlib2/javaobjectinterfacetm.cpp ---
    @@ -352,12 +349,11 @@ JOI_RetCode JavaObjectInterfaceTM::init(char*         
  className,
           // Allocate an object of the Java class, and call its constructor.
           // The constructor must be the first entry in the methods array.
           javaObj_ = _tlp_jenv->NewObject(javaClass, JavaMethods[0].methodID);
    -      if (javaObj_ == 0 || _tlp_jenv->ExceptionCheck())
    -      { 
    -        _tlp_jenv->ExceptionDescribe();
    -        _tlp_jenv->ExceptionClear();
    -        _tlp_jenv->DeleteLocalRef(javaClass);  
    -        return JOI_ERROR_NEWOBJ;
    +      if (getExceptionDetails(NULL)) {
    +         tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char 
*)"JavaObjectInterfaceTM::init()", 
    +             (char *)_tlp_error_msg->c_str(), -1LL);
    +         _tlp_jenv->DeleteLocalRef(javaClass);  
    --- End diff --
    
    In line 361 the global reference of the JavaClass needs to be retained. 
This ensures that the class reference is never unloaded via gc and all the 
method ids associated with the class remains valid. This was the one of the 
possible reasons for the obscure core seen in TM.
    
    For the error path case, it should be ok to delete the global reference, 
but the TM process is unusable and it would be aborted anyway


> Better java exception handling in the java layer of Trafodion
> -------------------------------------------------------------
>
>                 Key: TRAFODION-1988
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1988
>             Project: Apache Trafodion
>          Issue Type: Improvement
>          Components: dtm, sql-exe
>    Affects Versions: 2.1-incubating
>            Reporter: Selvaganesan Govindarajan
>            Assignee: Selvaganesan Govindarajan
>
> Java exceptions are not handled in consistent manner in Trafodion. The SQL 
> interface layer in Trafodion is capable of displaying the entire java stack 
> trace to the client application when an exception is raised in java portion 
> of the Trafodion/Hbase/Hdfs stack. However, there are portions of the code in 
> Trafodion where the exceptions are not handled in a consistent manner. This 
> JIRA attempts to fix this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to