mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 17:03:39 +08:00
优化数据源释放
This commit is contained in:
@@ -38,7 +38,16 @@ public class DefaultJdbcExecutor extends AbstractJdbcSqlExecutor {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Releasing DataSource ({}) JDBC Connection [{}]", getDatasourceId(), connection);
|
||||
}
|
||||
DataSourceUtils.releaseConnection(connection, DataSourceHolder.currentDataSource().getNative());
|
||||
try {
|
||||
DataSourceUtils.doReleaseConnection(connection, DataSourceHolder.currentDataSource().getNative());
|
||||
} catch (SQLException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception e2) {
|
||||
logger.error(e2.getMessage(), e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user