Improve iteration handling for BDB-JE