This is an automated email from the ASF dual-hosted git repository.
bstoyanov pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.18 by this push:
new 33be0ae745c Fix removal of usage records (#9442)
33be0ae745c is described below
commit 33be0ae745c758d2112e574b7a9c5b4079ca5fca
Author: Vishesh <[email protected]>
AuthorDate: Fri Jul 26 14:10:02 2024 +0530
Fix removal of usage records (#9442)
---
engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java
b/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java
index 038d17a85a3..c51496ade2e 100644
--- a/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java
@@ -476,16 +476,11 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO,
Long> implements Usage
TransactionLegacy txn = TransactionLegacy.currentTxn();
PreparedStatement pstmt = null;
try {
- txn.start();
pstmt =
txn.prepareAutoCloseStatement(DELETE_ALL_BY_INTERVAL);
pstmt.setLong(1, days);
pstmt.executeUpdate();
- txn.commit();
} catch (Exception ex) {
- txn.rollback();
s_logger.error("error removing old cloud_usage records for
interval: " + days);
- } finally {
- txn.close();
}
}
});