You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/12/15 05:04:59 UTC

[GitHub] [skywalking] raybi-asus edited a comment on pull request #6007: Add null-conditional operators on these 3 files

raybi-asus edited a comment on pull request #6007:
URL: https://github.com/apache/skywalking/pull/6007#issuecomment-745054369


   @wu-sheng @kezhenxu94 
   I uploaded a screenshot of error log
   ![NPE of Agent](https://user-images.githubusercontent.com/72775443/102171606-e4a46c80-3ed1-11eb-8fac-c4520e347a21.png)
   
   Actually the fix is not related to the trace. I think they are all traced, but 'T4CPreparedStatement' and 'OraclePreparedStatement' should be filtered out, because they weren't enhanced by 'correct' purpose.
   
   From ConnectionInstrumentation class in Oracle Plugin , I saw it does enhance PhysicalConnection,T4CConnection and intercept prepareStatement method. 
   As my preceding post , OraclePreparedStatementWrapper is the return value of 'prepareStatement' method in PhysicalConnection which was already enhanced in ConnectionInstrumentation.  Below is the method name in PhysicalConnection:
   public synchronized PreparedStatement prepareStatement(String paramString, Properties paramProperties) throws SQLException
   
   So , i guess OraclePreparedStatementWrapper was set StatementEnhanceInfos when the code intercept 'prepareStatement' method of PhysicalConnection. 
   
   About the question why 'T4CPreparedStatement' and 'OraclePreparedStatement' are not enhanced.  
   'T4CPreparedStatement' and 'OraclePreparedStatement' were actually enhanced. That's why they still can be intercepted by 'JDBCPreparedStatementSetterInterceptor.beforeMethod'. But they were intercepted by setString interceptor of ' T4CPreparedStatement, OraclePreparedStatementWrapper and OraclePreparedStatement' in 'OraclePrepareStatementInstrumentation' rather than 'PhysicalConnection.prepareStatement' , so they didn't inject StatementEnhanceInfos . That's the cause of NPE.
   
   That's my opinion.
   Please let me know if you have any concerns.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org