File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
framework/db/src/main/java/com/cloud/utils/db Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ public String resetConnection(String name) {
174174
175175 Connection conn = TransactionLegacy .getStandaloneConnection ();
176176 if (conn == null ) {
177- return "Unable to get anotehr db connection" ;
177+ return "Unable to get another db connection" ;
178178 }
179179
180180 concierge .reset (conn );
@@ -198,9 +198,13 @@ public String resetKeepAliveTask(int seconds) {
198198 protected void runInContext () {
199199 s_logger .trace ("connection concierge keep alive task" );
200200 for (Map .Entry <String , ConnectionConcierge > entry : _conns .entrySet ()) {
201+ String name = entry .getKey ();
201202 ConnectionConcierge concierge = entry .getValue ();
202203 if (concierge .keepAlive ()) {
203- testValidity (entry .getKey (), entry .getValue ().conn ());
204+ if (testValidity (name , concierge .conn ()) != null ) {
205+ s_logger .info ("Resetting DB connection " + name );
206+ resetConnection (name );
207+ }
204208 }
205209 }
206210 }
You can’t perform that action at this time.
0 commit comments