ruanwenjun commented on code in PR #14190:
URL:
https://github.com/apache/dolphinscheduler/pull/14190#discussion_r1267859572
##########
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-kyuubi/src/main/java/org/apache/dolphinscheduler/plugin/datasource/kyuubi/KyuubiDataSourceClient.java:
##########
@@ -59,7 +67,7 @@ public Connection getConnection() {
Connection connection = null;
while (connection == null) {
try {
- connection = dataSource.getConnection();
+ connection = driverManagerDataSource.getConnection();
Review Comment:
Please add max retry times here, this is dangerous code.
##########
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-kyuubi/src/main/java/org/apache/dolphinscheduler/plugin/datasource/kyuubi/KyuubiDataSourceClient.java:
##########
@@ -44,9 +48,13 @@ protected void preInit() {
@Override
protected void initClient(BaseConnectionParam baseConnectionParam, DbType
dbType) {
- this.dataSource =
JDBCDataSourceProvider.createOneSessionJdbcDataSource(baseConnectionParam,
dbType);
- this.jdbcTemplate = new JdbcTemplate(dataSource);
- log.info("Init {} success.", getClass().getName());
+ this.driverManagerDataSource =
+ new
DriverManagerDataSource(DataSourceUtils.getJdbcUrl(DbType.KYUUBI,
baseConnectionParam),
+ baseConnectionParam.getUser(),
PasswordUtils.decodePassword(baseConnectionParam.getPassword()));
+
driverManagerDataSource.setDriverClassName(baseConnectionParam.getDriverClassName());
+ this.jdbcTemplate = new JdbcTemplate(driverManagerDataSource);
+ log.info("Init {} {} success.", getClass().getName(),
+ DataSourceUtils.getJdbcUrl(DbType.KYUUBI,
baseConnectionParam));
Review Comment:
We don't need to use `DriverManagerDataSource` here, we can directly
generate new connections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]