Database: enhanced iterator reseting