File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
engine/schema/src/main/java/com/cloud/configuration/dao Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -266,18 +266,18 @@ public long countMemoryAllocatedToAccount(long accountId) {
266266 }
267267
268268 private long executeSqlCountComputingResourcesForAccount (long accountId , String sqlCountComputingResourcesAllocatedToAccount ) {
269- try (TransactionLegacy tx = TransactionLegacy .currentTxn ()) {
269+ TransactionLegacy tx = TransactionLegacy .currentTxn ()
270+ try {
270271 PreparedStatement pstmt = tx .prepareAutoCloseStatement (sqlCountComputingResourcesAllocatedToAccount );
271272 pstmt .setLong (1 , accountId );
272273
273274 ResultSet rs = pstmt .executeQuery ();
274275 if (!rs .next ()) {
275- throw new CloudRuntimeException ( String . format ( "An unexpected case happened while counting allocated computing resources for account: " + accountId )) ;
276+ return 0L ;
276277 }
277278 return rs .getLong ("total" );
278279 } catch (SQLException e ) {
279280 throw new CloudRuntimeException (e );
280281 }
281282 }
282-
283- }
283+ }
You can’t perform that action at this time.
0 commit comments