Hello, we have a few databases that are receiving what seems like intermittent "No Current Row of Cursor" errors. Here is the application exception: No current row of cursor
Message: No current row of cursor
StackTrace: at Sap.Data.SQLAnywhere.SAException.CheckException(Int32 idEx)
at Sap.Data.SQLAnywhere.SADataReader.FetchValue(Int32 ordinal, DotNetType dotNetType, Boolean throwExIfDBNull, Boolean isGetValue)
at Sap.Data.SQLAnywhere.SADataReader.GetValue(Int32 ordinal)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader I enabled SQL logging, here is a portion of that that captures the error: =,<,52,PREFETCH,65555 =,>,52 =,<,52,GETDATA,65555 =,E,52,-197,No current row of cursor =,>,52 +8,<,52,GETDATA,65555 =,E,52,-197,No current row of cursor =,>,52 +2,<,52,GETDATA,65555 =,E,52,-197,No current row of cursor =,>,52 =,<,52,CLOSE,65555 Any help would be appreciated. We are running on SA 17.0.11.6800. Sap.Data.SQLAnywhere.EF6.dll - 17.0.6.27574 Sap.Data.SQLAnywhere.v4.5.dll - 17.0.6.27574 Billy |
I guess the error description does tell it all for SQLCODLE -197 (SQLE_NO_CURRENT_ROW):
Yes, thank you. This is intermittent so its not like its happening every time. Do you have any ideas as to what could cause this?
(09 Dec '22, 10:22)
BBuck
Replies hidden
Well, I can't tell whether your code might try to access rows before the first or after the last row. If this intermitent, I would suspect you are trying to access deleted rows. For this topics like concurrent access, isolation levels and cursor sensitivity seem relevant. I.e. if your cursor computes its rowset's membership during opening (say, via a value-sensitive cursor), further fetches might try to read a row that has been deleted by a different transaction in between, and this will issue this error.
(09 Dec '22, 10:57)
Volker Barth
Let me add a little more information. There are several environments that are experiencing this issue, however, the vast majority are not. It does seem that we were able to clear up this issue in one environment by performing an unload/reload of the database. However, we don't know WHY this fixes the issue. Because of this, it seems to be database related but we don't have much to go on, other than the error that was previously posted. We can reproduce this issue consistently in one of the environments but not sure where to look next.
(09 Dec '22, 12:30)
BBuck
|
Be careful with memo (long nvarchar) fields, for these operate a little different. I think you are getting an EOF and this still tries to fetch that last (non existing) record. For it's at the EOF the normal fetch doesn't reply anything, but since it has memo fields, these will still try to fetch, ignoring the EOF flag. Try this without any (n)varchar fields. Also, do you have the exact sql-request that triggered this error? Are you relating to the MaxLength connection parameter? If fetching long data (which usually requires SQLGetData calls) would fail, I would suspect another error message...
(03 Jan, 09:24)
Volker Barth
|