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 03:37:52 UTC

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

raybi-asus commented on pull request #6007:
URL: https://github.com/apache/skywalking/pull/6007#issuecomment-745031231


   > Why the statementEnhanceInfos could be null? I am feeling this could be a bug.
   
   Hello , the case is for PrepareStatement operation and Trace_SQL_Parameter=true. 
   Please refer to the attachment 1
   Usually we use 'prepareStament' for methods matcher :
   ![agent_connectionInstrumentation](https://user-images.githubusercontent.com/72775443/102162357-00a11180-3ec4-11eb-91b9-88ba7f892f2f.png)
   
   In ojdbc driver PhysicalConnection has prepareStatement method with 2 arguments like below , it will return OraclePreparedStatementWrapper object: 
   ![OraclePreparedStatementWrapper](https://user-images.githubusercontent.com/72775443/102167331-28df3f00-3ec9-11eb-8923-b12004373207.png)
   
   Then , when we invoke afterMethod , the code would set connection and StatementEnhanceInfos to the object which was returned from last step
   ![CreateInterceptor](https://user-images.githubusercontent.com/72775443/102167458-65ab3600-3ec9-11eb-8cad-c0ad5a525a9d.png)
   
   Hence , if we try to intercept setString method , the operation for OraclePreparedStatementWrapper runs well , but for internal invocations(Who also have setString method) such as 'T4CPreparedStatement' and 'OraclePreparedStatement', both of them don't have StatementEnhanceInfos , the NPE would be coming up.


----------------------------------------------------------------
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