[GOBBLIN-50] Every time createJdbcSource() is called, new JdbcProvider is assigned to this.jdbcSource.
Every time createJdbcSource() is called, new JdbcProvider is assigned to 'this.jdbcSource'. It means that it lose exist jdbcSource. Therefore, even though closeConnection() is called, lost connections from this.jdbcSource remains connected. So, I moved createJdbcSource(), this.jdbcSource.getConnection() to construct of JdbcExtractor.
I'm using a gobblin-core as a module of web application not a batch. The more JdbcSource is executed, the more connections will cause problems. (The number of connections become a maximum number of allowed connections soon.)
@sungpeo : There seem to be test failures. Can you figure out why they are failing?
./gradlew :gobblin-core:test
-- snippet from Travis build: https://travis-ci.org/linkedin/gobblin/jobs/204660255
Gradle suite > Gradle test > gobblin.source.extractor.watermark.TimestampWatermarkTest.testGetWatermarkConditionMySql STARTED Gradle suite > Gradle test > gobblin.source.extractor.watermark.TimestampWatermarkTest.testGetWatermarkConditionMySql FAILED java.lang.NullPointerException at TimestampWatermarkTest.java:61 Gradle suite > Gradle test > gobblin.source.extractor.watermark.TimestampWatermarkTest.testGetWatermarkConditionSqlServer STARTED Gradle suite > Gradle test > gobblin.source.extractor.watermark.TimestampWatermarkTest.testGetWatermarkConditionSqlServer FAILED java.lang.NullPointerException at TimestampWatermarkTest.java:68
https://issues.apache.org/jira/browse/GOBBLIN-50
Please update your PR title with following prefix: [GOBBLIN-50]