From 5fdfed57063b44850abc456390600125dd977802 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 24 Feb 2002 17:01:33 +0000 Subject: [PATCH] make sure that batches have the correct "ORDER BY".. same problem in ProducerImages.. it's been there for a while.. --- source/mircoders/producer/ProducerContent.java | 11 +++++++---- source/mircoders/producer/ProducerImages.java | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/mircoders/producer/ProducerContent.java b/source/mircoders/producer/ProducerContent.java index 670c2d68..195a3e7b 100755 --- a/source/mircoders/producer/ProducerContent.java +++ b/source/mircoders/producer/ProducerContent.java @@ -90,7 +90,7 @@ public class ProducerContent extends Producer { //if true produces a single contentitem if(id !=null){ whereClause += " AND id="+id; - // I think this avoids a select count(*)... + // this avoids a select count(*)... contentBatchsize=-1; } batchEntityList = contentModule.getContent(whereClause, orderBy, 0, @@ -129,9 +129,12 @@ public class ProducerContent extends Producer { }//for // if next batch get it... if (batchEntityList.hasNextBatch()){ - batchEntityList = contentModule.getByWhereClause(whereClause, - null, batchEntityList.getNextBatch(), - contentBatchsize); + //batchEntityList = contentModule.getByWhereClause(whereClause, + // null, batchEntityList.getNextBatch(), + // contentBatchsize); + batchEntityList = contentModule.getContent(whereClause, orderBy, + batchEntityList.getNextBatch(), + contentBatchsize, userEntity); } else { batchEntityList=null; } diff --git a/source/mircoders/producer/ProducerImages.java b/source/mircoders/producer/ProducerImages.java index 132c8d30..e18c850d 100755 --- a/source/mircoders/producer/ProducerImages.java +++ b/source/mircoders/producer/ProducerImages.java @@ -40,6 +40,7 @@ public class ProducerImages extends Producer { String productionPath; EntityImages currentImage; EntityList batchEntityList; + String orderBy = "date desc, webdb_lastchange desc"; int contentBatchsize = Integer.parseInt(MirConfig.getProp("Producer.Content.Batchsize")); String imageHost = MirConfig.getProp("Producer.Image.Host"); @@ -52,7 +53,7 @@ public class ProducerImages extends Producer { whereClause += " and id="+id; if (force==false) whereClause += " and icon_is_produced='0'"; - batchEntityList = imageModule.getByWhereClause(whereClause, null, 0, contentBatchsize); + batchEntityList = imageModule.getByWhereClause(whereClause, orderBy, 0, contentBatchsize); theLog.printDebugInfo("whereclause: " + whereClause); @@ -98,7 +99,7 @@ public class ProducerImages extends Producer { // if next batch get it... if (batchEntityList.hasNextBatch()){ batchEntityList = imageModule.getByWhereClause(whereClause, - null, batchEntityList.getNextBatch(), + orderBy, batchEntityList.getNextBatch(), contentBatchsize); } else { batchEntityList=null; -- 2.11.0