A StackOverflowError occurs if there are too many commits in the database while reading indexes recursively. An iterative approach eliminates this problem. Also, there's a test to check it. But it's slow due to the need of many fsync commits.