Status: Closed (View Workflow)
Resolution: Not a Bug
AWS Aurora MySQL 5.6
not really a bug but this looks like the best place to ask and I am a bit lost.
I am regulary seeing a "Current position is after the last row" SQLException in my production logs. I have no idea why they happen and I am unable to reproduce the error on my local machine. In addition, this exception does not happen every time. Just a small fraction within thousands of other statements that do work.
Unfortunately reading the source code didn't help me much either. I know why the error happens, but I don't understand why this situation even occurs. rowPointer >= dataSize should never happen.
Here are the steps I do in production
- connection.prepareStatement("SELECT * FROM Table WHERE Id = ? FOR UPDATE",
- Next I check the ResultSet (rs) returned from executeQuery
- If rs.next() is true
- I might do an rs.updateRow()
- If rs.next() is false
- rs.moveToInsertRow(), some rs.updateXZY and followed by rs.insertRow()
In summary I do a insert row if it doesn't exist otherwise I might update the row.
Any ideas how to narrow this one down?