JoaoJandre commented on code in PR #8740:
URL: https://github.com/apache/cloudstack/pull/8740#discussion_r1513204284


##########
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java:
##########
@@ -1208,9 +1208,14 @@ public boolean expunge(final ID id) {
         }
     }
 
-    // FIXME: Does not work for joins.
     @Override
     public int expunge(final SearchCriteria<T> sc) {
+        return expunge(sc, -1);
+    }
+
+    // FIXME: Does not work for joins.
+    @Override
+    public int expunge(final SearchCriteria<T> sc, long limit) {

Review Comment:
   I'd rather stick with the simpler long limit, as I don't see any need to use 
the Filter's features on an expunge.



##########
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java:
##########
@@ -1223,6 +1228,11 @@ public int expunge(final SearchCriteria<T> sc) {
             str.append(sc.getWhereClause());
         }
 
+        if (limit > 0) {

Review Comment:
   Could you give an example where we would want to order the deletes? This 
would only make the deletes even slower. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to