Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix-4653]fix jdbc connection cache error #4654

Merged
merged 3 commits into from
Jun 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ class JDBCEngineConnExecutor(override val outputPrintLimit: Int, val id: Int)
var resultSet: ResultSet = null
logger.info(s"The data source properties is $properties")
Utils.tryCatch({
val dataSourceIdentifier = s"$dataSourceName-$dataSourceMaxVersionId"
/* url + user as the cache key */
val jdbcUrl: String = properties.get(JDBCEngineConnConstant.JDBC_URL)
val execUser: String = properties.get(JDBCEngineConnConstant.JDBC_SCRIPTS_EXEC_USER)
val proxyUser: String = properties.get(JDBCEngineConnConstant.JDBC_PROXY_USER_PROPERTY)
var dataSourceIdentifier = s"$jdbcUrl-$execUser-$proxyUser"
/* If datasource is used, use datasource name as the cache key */
if (StringUtils.isNotBlank(dataSourceName)) {
dataSourceIdentifier = s"$dataSourceName-$dataSourceMaxVersionId"
casionone marked this conversation as resolved.
Show resolved Hide resolved
}
connection = connectionManager.getConnection(dataSourceIdentifier, properties)
logger.info("The jdbc connection has created successfully!")
}) { e: Throwable =>
Expand Down