The "ok" result of nextLocked is intended to report whether, when the
method returns, the Rows is pointing at valid data. The "doClose"
result reports whether the Rows should be closed. Given that
understanding, the behavior of Next looks reasonable to me.
As it happens when the current implementation returns "doClose" as
true, it always returns "ok" as false. So the test "if doClose &&
!ok" is not strictly necessary; it could be replaced with "if
doClose". But the current code doesn't seem wrong to me.
Can you show a code sequence that seems buggy to you?
Ian