mirror of https://github.com/apache/cloudstack.git
Fix removal of usage records (#9442)
This commit is contained in:
parent
e41add31e7
commit
33be0ae745
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue