Skip to content

Commit

Permalink
cdk/dbmetadata-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gisripa committed Jan 25, 2024
1 parent 180da5d commit 55f3d50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -73,6 +73,17 @@ public <T> Stream<T> unsafeResultSetQuery(final CheckedFunction<Connection, Resu
});
}

/**
* Implementations of DatabaseMetadata hold a reference of the Connection object. It is safe to use this to retrieve
* static information like getIndentifierQuoteString() etc but calling methods which return a ResultSet needs the connection
* to be still open. This may or may not work depending on how the underlying Connection object is handled
* eg. Hikari's ProxyConnection is not actually closed, rather recycled into Pool.
* See {@link #execute(CheckedConsumer)} which gives the caller a safe alternative to access ResultSet methods of DatabaseMetadata
* in the consumer before closing connection.
* @return
* @throws SQLException
*/
@Deprecated
@Override
public DatabaseMetaData getMetaData() throws SQLException {
try (final Connection connection = dataSource.getConnection()) {
Expand Down
3 changes: 1 addition & 2 deletions airbyte-cdk/java/airbyte-cdk/settings.gradle
Expand Up @@ -12,5 +12,4 @@ include ':airbyte-cdk:java:airbyte-cdk:core'
include ':airbyte-cdk:java:airbyte-cdk:db-sources'
include ':airbyte-cdk:java:airbyte-cdk:db-destinations'
include ':airbyte-cdk:java:airbyte-cdk:s3-destinations'
// Leaving this out until we fully commit to moving this to the cdk
//include ':airbyte-cdk:java:airbyte-cdk:typing-deduping'
include ':airbyte-cdk:java:airbyte-cdk:typing-deduping'

0 comments on commit 55f3d50

Please sign in to comment.