Partial fix for MOB-1609: Incorrect number of results returned from audit log - size parameter is not correctly processed

- This will pull back the correct number if you request less than the total number of audit entries
 - TODO: You can still get N-1 entries if you request more than the total number of entries
 - TODO: Reverse order of limited queries (last N)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16518 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-09-25 12:09:38 +00:00
parent 9c05bc8ca1
commit 5f50bf11e7

View File

@@ -258,7 +258,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
if (maxResults > 0) if (maxResults > 0)
{ {
// Calculate the maximum results required // Calculate the maximum results required
int sqlMaxResults = (maxResults > 0 ? ((maxResults+1) * 20) : Integer.MAX_VALUE); int sqlMaxResults = (maxResults > 0 ? ((maxResults+1) * 100) : Integer.MAX_VALUE);
List<AuditQueryResult> rows = template.queryForList(SELECT_ENTRIES_WITH_VALUES, params, 0, sqlMaxResults); List<AuditQueryResult> rows = template.queryForList(SELECT_ENTRIES_WITH_VALUES, params, 0, sqlMaxResults);
for (AuditQueryResult row : rows) for (AuditQueryResult row : rows)