was missing an orderBy
authorcvs <cvs>
Sat, 30 Mar 2002 17:26:18 +0000 (17:26 +0000)
committercvs <cvs>
Sat, 30 Mar 2002 17:26:18 +0000 (17:26 +0000)
source/mircoders/producer/ProducerMedia.java

index ec74e06..a44dc43 100755 (executable)
@@ -31,12 +31,14 @@ abstract public class ProducerMedia extends Producer {
     long                sessionConnectTime = 0;
     long                startTime = (new java.util.Date()).getTime();
     String              whereClause;
+    String              orderBy;
     Entity              currentMedia;
     MirMedia            currentMediaHandler;
     EntityList          batchEntityList;
 
     int contentBatchsize =
             Integer.parseInt(MirConfig.getProp("Producer.Content.Batchsize"));
+    orderBy = "date desc, webdb_lastchange desc";
 
     // get batch of non-produced medias, that are to be published
     whereClause="is_published='1'";
@@ -48,7 +50,7 @@ abstract public class ProducerMedia extends Producer {
     if (force==false) whereClause += " and is_produced='0'";
 
     batchEntityList = getStorage().selectByWhereClause(whereClause,
-                                                null, 0, contentBatchsize);
+                                                orderBy, 0, contentBatchsize);
 
     while (batchEntityList != null) {
       for(int i=0;i<batchEntityList.size();i++) {
@@ -80,7 +82,7 @@ abstract public class ProducerMedia extends Producer {
       // if next batch get it...
       if (batchEntityList.hasNextBatch()){
         batchEntityList = uploadedMediaModule.getByWhereClause(whereClause,
-          null, batchEntityList.getNextBatch(),contentBatchsize);
+          orderBy, batchEntityList.getNextBatch(),contentBatchsize);
       } else {
         batchEntityList=null;
       }