fix: cursor over limit when sync
This commit is contained in:
parent
137923c740
commit
770b22ca16
|
@ -94,11 +94,15 @@ public class JdbcColumnMetaRepository implements ColumnMetaRepository {
|
||||||
TableCondition tableCondition) throws SQLException {
|
TableCondition tableCondition) throws SQLException {
|
||||||
ResultSet result = meta.getPrimaryKeys(tableCondition.getDatabaseName(),
|
ResultSet result = meta.getPrimaryKeys(tableCondition.getDatabaseName(),
|
||||||
tableCondition.getSchemaName(), tableCondition.getTableName());
|
tableCondition.getSchemaName(), tableCondition.getTableName());
|
||||||
List<String> columns = new ArrayList<>();
|
try {
|
||||||
while (result.next()) {
|
List<String> columns = new ArrayList<>();
|
||||||
String columnName = result.getString("COLUMN_NAME");
|
while (result.next()) {
|
||||||
columns.add(columnName);
|
String columnName = result.getString("COLUMN_NAME");
|
||||||
|
columns.add(columnName);
|
||||||
|
}
|
||||||
|
return columns;
|
||||||
|
} finally {
|
||||||
|
result.close();
|
||||||
}
|
}
|
||||||
return columns;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,9 @@ public class JdbcForeignKeyMetaRepository implements ForeignKeyMetaRepository {
|
||||||
log.warn("warn: ignore foreign keys in " + databaseName + "." + tableName + ", " + e.getMessage());
|
log.warn("warn: ignore foreign keys in " + databaseName + "." + tableName + ", " + e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
keyResult.close();
|
if (keyResult != null) {
|
||||||
|
keyResult.close();
|
||||||
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.warn("warn: close key result error " + databaseName + "." + tableName + ", " + e.getMessage());
|
log.warn("warn: close key result error " + databaseName + "." + tableName + ", " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue