mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 07:51:04 +00:00
#2024 - Change default "fetchBuffer" for findEach/iterate/stream queries to 100
This commit is contained in:
@@ -608,7 +608,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfileTran
|
||||
}
|
||||
|
||||
QueryIterator<T> readIterate(int bufferSize, OrmQueryRequest<T> request) {
|
||||
if (bufferSize < 2) {
|
||||
if (bufferSize == 1) {
|
||||
return new CQueryIteratorSimple<>(this, request);
|
||||
} else {
|
||||
return new CQueryIteratorWithBuffer<>(this, request, bufferSize);
|
||||
|
||||
@@ -228,6 +228,8 @@ public class CQueryEngine {
|
||||
int queryBatch = request.getQuery().getLazyLoadBatchSize();
|
||||
if (queryBatch > 0) {
|
||||
iterateBufferSize = queryBatch;
|
||||
} else {
|
||||
iterateBufferSize = 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ public class TestQueryFindIterate extends BaseTestCase {
|
||||
.order().asc("id");
|
||||
|
||||
if (withLoadBatch) {
|
||||
query.setLazyLoadBatchSize(100);
|
||||
query.setLazyLoadBatchSize(1);
|
||||
}
|
||||
|
||||
QueryIterator<Customer> queryIterator = query.findIterate();
|
||||
|
||||
Reference in New Issue
Block a user