File tree Expand file tree Collapse file tree
engine/schema/src/com/cloud/configuration/dao Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,17 +276,18 @@ public long countMemoryAllocatedToAccount(long accountId) {
276276 }
277277
278278 private long executeSqlCountComputingResourcesForAccount (long accountId , String sqlCountComputingResourcesAllocatedToAccount ) {
279- try (TransactionLegacy tx = TransactionLegacy .currentTxn ()) {
279+ TransactionLegacy tx = TransactionLegacy .currentTxn ();
280+ try {
280281 PreparedStatement pstmt = tx .prepareAutoCloseStatement (sqlCountComputingResourcesAllocatedToAccount );
281282 pstmt .setLong (1 , accountId );
282283
283284 ResultSet rs = pstmt .executeQuery ();
284285 if (!rs .next ()) {
285- throw new CloudRuntimeException ( String . format ( "An unexpected case happened while counting allocated computing resources for account: " + accountId )) ;
286+ return 0L ;
286287 }
287288 return rs .getLong ("total" );
288289 } catch (SQLException e ) {
289290 throw new CloudRuntimeException (e );
290291 }
291292 }
292- }
293+ }
You can’t perform that action at this time.
0 commit comments