137138139140141142143144145146147
EOEditingContext ec = ERXEC.newEditingContext(); iterator.setEditingContext(ec); ec.lock(); try { iterator.batchCount(); } finally { ec.unlock(); } ec.dispose(); while (iterator.hasNextBatch()) {