Closed RutgerLubbers closed 4 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/main/java/io/opentracing/contrib/jdbc/TracingDataSource.java | 1 | 2 | 50.0% | ||
src/main/java/io/opentracing/contrib/jdbc/TracingConnectionWrapper.java | 25 | 97 | 25.77% | ||
<!-- | Total: | 27 | 100 | 27.0% | --> |
Totals | |
---|---|
Change from base Build 238: | 0.0% |
Covered Lines: | 449 |
Relevant Lines: | 967 |
@RutgerLubbers if TracingConnection
is created as proxy:
Connection tracingConnection = WrapperProxy
.wrap(connection, new TracingConnection(connection, connectionInfo, withActiveSpanOnly,
ignoreStatements, tracer))
Does it have the same issue? Creating proxy connection is more correct way than direct constructor to avoid issues with casting to real connection class. cc @safris
not needed
Created an interface for TracingConnection, renamed old class (with same name) into TracingConnectionWrapper.
This allows checking whether a connection has already been wrapped. And prevents an exception with (at least) the Oracle JDBC driver, where the
isWrapperFor
method only accepts interfaces.After this
opentracing-contrib/java-spring-cloud
should be adepted to use this code.