I am querying from the XYZABC database through my application . I am getting the following error often.
CLI0115E Invalid cursor state. SQLSTATE=24000
DB2 - 10.1
SQL - 2005
Application on .net framework 4.0
Windows Server 2008 R2
background of the existing db2 connectivity:
1) We are using the “Select” query to get the results from the DB2 Database.
2) We are using the db2 data server package (db2 drives) to connect the Db2 db.
3) We are not inserting any record to db. We are trying to pull the records from the database using Select query, not through any Stored procedure, function, etc.
4) We are using this switch at the end of the query - “FOR READ ONLY WITH UR” for Uncommitted Read.
5) Code Attached.
When we fetch the recordset, an implicit cursor is created at the backend. Once the transaction is finished, it is not clearing automatically.
But, sometimes, they are clearing correctly and we are not getting error at that point of time.
Please post your comments too and let me know if you need further details on this.