Skip to content

Commit

Permalink
Set maxConnections optional in incoming schema for JdbcSchemaIOProvid…
Browse files Browse the repository at this point in the history
…er (#25062) (#25066)
  • Loading branch information
Abacn authored Jan 20, 2023
1 parent 696469f commit dbc10db
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ protected JdbcIO.DataSourceConfiguration getDataSourceConfiguration() {
dataSourceConfiguration = dataSourceConfiguration.withConnectionInitSqls(initSqls);
}

@Nullable Integer maxConnections = config.getInt32("maxConnections");
if (maxConnections != null) {
dataSourceConfiguration = dataSourceConfiguration.withMaxConnections(maxConnections);
if (config.getSchema().hasField("maxConnections")) {
@Nullable Integer maxConnections = config.getInt32("maxConnections");
if (maxConnections != null) {
dataSourceConfiguration = dataSourceConfiguration.withMaxConnections(maxConnections);
}
}

return dataSourceConfiguration;
Expand Down

0 comments on commit dbc10db

Please sign in to comment.