Skip to content

Commit f018082

Browse files
authored
fix:DruidDatasource无法关闭closed (#637) (#638)
* fix:DruidDatasource无法关闭closed (#637) * fix:DruidDatasource无法关闭closed (#637) --------- Co-authored-by: shencj10 <MX123567@>
1 parent f97f8ba commit f018082

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dynamic-datasource-spring/src/main/java/com/baomidou/dynamic/datasource/DynamicRoutingDataSource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ private void closeDataSource(String ds, DataSource dataSource, boolean graceDest
290290
}
291291
}
292292
}
293+
294+
if (null == realDataSource) {
295+
realDataSource = dataSource;
296+
}
293297
if (null != realDataSource) {
294298
DataSourceDestroyer destroyer = new DefaultDataSourceDestroyer();
295299
if (graceDestroy) {

0 commit comments

Comments
 (0)