You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/03/13 10:41:42 UTC
[GitHub] [shardingsphere] huangxfchn edited a comment on issue #15086: Cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource
huangxfchn edited a comment on issue #15086:
URL: https://github.com/apache/shardingsphere/issues/15086#issuecomment-1066073345
@terrymanu
Hi~,Brother Liang. My project also uses open-tracing for jdbc, it will proxy the **getConnection()** method of **javax.sql.DataSource**, and spring 2.x uses cglib proxy by default, but ShardingSphereDataSource is a final class. So, if the DataSource is proxied, this exception will occur. The similar code like this:
```
@Aspect
public class JdbcAspect {
@Around("execution(java.sql.Connection *.getConnection(..)) && target(javax.sql.DataSource)")
public Object getConnection(final ProceedingJoinPoint pjp) throws Throwable {
return new TracingConnection(conn);
}
}
```
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org