SQL Serve cursor still alive

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Licences AAW
Posts: 10
Joined: Tue 21 Jul 2015 07:43

SQL Serve cursor still alive

Post by Licences AAW » Tue 03 May 2016 14:46

Hello,

using UniDac 6.2.10, is there a way to know if (and, icing on the cake, how much) query cursor are still alive.

I mean, if I have a query that should return more than 25 records (default fetch packet size), and the cursor is server side, SQL Server will not allow to start a transaction until the query is closed or fully fetched.

I would add a test in my code to check if some queries will avoid transaction opening.
Is it possible?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: SQL Serve cursor still alive

Post by azyk » Thu 05 May 2016 09:51

You can retrieve the list of the opened cursors using the sp_cursor_list stored procedure. To learn more abut sp_cursor_list, refer to the MSDN site: https://msdn.microsoft.com/en-us/library/ms186256.aspx .

If server cursor is used in dataset, values of the FetchRows, FetchAll properties do not have influence on behavior of dataset. See more details about using server cursors in SDAC documentation at https://www.devart.com/sdac/docs/index. ... ortype.htm

Post Reply