skywalking-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [skywalking-java] wu-sheng commented on a change in pull request #18: fix multi-db-instance on same host port
Date Sat, 04 Sep 2021 07:37:41 GMT

wu-sheng commented on a change in pull request #18:
URL: https://github.com/apache/skywalking-java/pull/18#discussion_r702250942



##########
File path: apm-sniffer/apm-sdk-plugin/mysql-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/v6/ConnectionCreateOldInterceptor.java
##########
@@ -41,7 +41,12 @@ public void beforeMethod(Class clazz, Method method, Object[] allArguments,
Clas
     public Object afterMethod(Class clazz, Method method, Object[] allArguments, Class<?>[]
parameterTypes,
         Object ret) {
         if (ret instanceof EnhancedInstance) {
-            ConnectionInfo connectionInfo = ConnectionCache.get(allArguments[1].toString(),
allArguments[2].toString());
+            String database = "";
+            try {
+                Method getDbMethod = parameterTypes[0].getDeclaredMethod("getDatabase");
+                database = (String) getDbMethod.invoke(allArguments[0]);
+            } catch (Throwable t) { }

Review comment:
       They should be separated, and use witness class to identify the versions.




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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



Mime
View raw message