|
1. Are you also going to fix InExpression to honor the DBDictionary's new in clause limit?
2. After reviewing the patch some more, I propose the following simplified version: // try to find a good page size. if the known size < batch size, use // it. if the batch size is set, then use that; if it's sorta close // to the size, then use the size / 2 to get two full pages rather // than a possible big one and small one int batch = getFetchConfiguration().getFetchBatchSize(); int pageSize; if (batch < 0) pageSize = (int) size; else { if (batch == 0) batch = 50; // reasonable default if (size <= batch) pageSize = (int) size; else if (size <= batch * 2) { if (size % 2 == 0) pageSize = (int) (size / 2); else pageSize = (int) (size / 2 + 1); } else pageSize = batch; } 1 - Yes, was planning to do it as a separate JIRA given that it directly does not concern the issue raised here, however I will include it here since we are introducing the in-clause limit in the DBDictionary for this fix.
2 - Looks fine to me, except for the minor issue that in the (size <= batch * 2) case we will not be adhering to the FetchBatchSize for pageSize in that the first in-clause query will be for lesser than the FetchBatchSize number of entries, however we will still endup running the same number of in-clause queries - 2. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- The proposed patch doesn't handle the common cases where the FetchBatchSize is -1 (unlimited) or 0 (driver default).
- I'm a little nervous about defaulting the in clause limit to "unlimited" when we don't have much info on actual database limits other than Oracle.