commit in chunks in sampling tool to avoid large JPA transactions