| I've only patched these files for myself without any proper testing but I present below more details about it. I'm sorry but this is as much I'm able to put an effort to the case. Each time the extractionContext.getJdbcConnection() or extractionContext.getJdbcDatabaseMetaData() is called a proper extractionContext.cleanup must follow. Same applies to SequenceInformationExtractorH2DatabaseImpl .
public class SequenceInformationExtractorLegacyImpl implements SequenceInformationExtractor {
@Override
public Iterable<SequenceInformation> extractMetadata(ExtractionContext extractionContext) throws SQLException {
...
final Connection connection = extractionContext.getJdbcConnection();
try {
final Statement statement = connection.createStatement();
try {
...
} finally {
try {
statement.close();
} catch (SQLException ignore) {}
}
} finally {
extractionContext.cleanup();
}
}
}
Most public methods (catalogExists,getColumn,getForeignKeys,getIndexes,getPrimaryKey,getTable,schemaExists) of InformationExtractorJdbcDatabaseMetaDataImpl suffer from this as well and here it revolves mostly around database metadata that might have some optimization issues if it's retrieved again and again each time these methods are called (as I had done). The most complex case was in the JpaSchemaGenerator but that seems to have been "resolved" in the latest deprecation process. |