File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
hsweb-web-datasource/src/main/java/org/hsweb/web/datasource/dynamic Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public javax.sql.DataSource getDataSource(String id) {
64
64
@ PreDestroy
65
65
public void destroyAll () throws Exception {
66
66
cache .values ().stream ().map (CacheInfo ::getDataSource ).forEach (this ::closeDataSource );
67
+ cache .clear ();
67
68
}
68
69
69
70
protected void closeDataSource (javax .sql .CommonDataSource ds ) {
@@ -156,6 +157,7 @@ protected javax.sql.DataSource createDataSource(DataSource dataSource) {
156
157
success [0 ] = true ;
157
158
} catch (AtomikosSQLException e ) {
158
159
closeDataSource (dataSourceBean );
160
+ cache .remove (dataSource .getId ());
159
161
}
160
162
}).start ();
161
163
//初始化检测
@@ -165,6 +167,7 @@ protected javax.sql.DataSource createDataSource(DataSource dataSource) {
165
167
if (!success [0 ]) {
166
168
logger .error ("初始化jdbc超时:{}" , dataSourceBean );
167
169
closeDataSource (dataSourceBean );
170
+ cache .remove (dataSource .getId ());
168
171
}
169
172
} catch (Exception e ) {
170
173
You can’t perform that action at this time.
0 commit comments