java.sql.SQLException: Exhausted Resultset
you might guessed that this error happen when you trying to access a resultset which already being closed or never been advanced to the first record, but you very certain that the statement is never been closed or always advanced to the first record and still these kind of error spitting out in your log or console, you might wanna check if the same statement object had been re-executed. In my case another thread executing the same statement object, thus the previous resultset is reset.
- thread A is executing the statement and get the resultset X
- thread A advance the resultset X by calling X.next()
- thread B is executing the statement and get the resultset Y
- thread A try to call X.getString("some_field") => spit the error
- thread B advance the resultset Y by calling Y.next()
- thread B try to call Y.getString("some_field") => working fine
took me whole night figure this one out, should have read the spec earlier, stupid me...