opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

Make TracingDataSource implements AutoCloseable #76

Closed quaff closed 4 years ago

quaff commented 4 years ago

Container like spring ApplicationContext will close underlying DataSource automatically.

    @Bean
    public DataSource dataSource() {
        DataSource ds = createDataSource();
        if (tracingEnabled) {
            ds = new TracingDataSource(tracingConfiguration.getTracer(), ds);
            //the underlying ds will not be closed since it's not managed by spring now
        }
        return ds;
    }
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 257


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/io/opentracing/contrib/jdbc/TracingDataSource.java 0 3 0.0%
<!-- Total: 0 3 0.0% -->
Totals Coverage Status
Change from base Build 253: -0.1%
Covered Lines: 468
Relevant Lines: 979

💛 - Coveralls