Re: Batch iteration
I would use a peer context. You can create a peer context like this if you runtime has been bound to the current thread using CayenneRuntime.bindThreadInjector(runtime.getInjector()) public static ObjectContext newObjectContext() { ObjectContextFactory factory = CayenneRuntime.getThreadInjector
Batch iteration
I’m using ResultBatchIterator like this: Consumer forEach = ... try (ResultBatchIterator iterator = query.batchIterator(context, batchSize)) { for(List batch : iterator) { for (T c : batch) {