You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server Version :2.5.3.26543 [Windows, SuperClassic, 64bit]
Client Version :2.5.3.26543 [Windows, 32bit]
Database ODS :11.2
Database Dialect:3
Connection through "localhost".
Work from 32bit application.
-----------------------------------------------
Common scenario:
1. thread1: execute statement "select ID,DUMMY from SP_PAUSE_FETCH(1000,10000000)"
2. thread2: fetch one row
3. thread1: cancel fetch (and wait the finish of cancelation)
4. thread1: close cursor
5. thread1: execute statment again
6. thread2: fetch one row -> ERROR "Attempt to reopen an open cursor"
-----------------------------------------------
Sequence of ISC API calls:
11:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000001]: isc_dsql_allocate_statement(...,db_handle=&00000002,stmt_handle=&00000000)
12:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000001]: isc_dsql_allocate_statement(...,db_handle=&00000002,stmt_handle=&00000004) return OK.
13:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000002]: isc_dsql_prepare(...,tr_handle=&00000003,stmt_handle=&00000004,...)
[stmt_text len:50]
select ID,DUMMY from SP_PAUSE_FETCH(1000,10000000)
[/stmt_text]
14:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000002]: isc_dsql_prepare(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
15:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000003]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...)
16:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000003]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
17:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#000004]: isc_dsql_fetch(...,stmt_handle=&00000004,...)
18:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000005]: fb_cancel_operation(,db_handle=&00000002,option=3)
19:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000005]: fb_cancel_operation(,db_handle=&00000002,option=3) return OK.
20:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000006]: fb_cancel_operation(,db_handle=&00000002,option=3)
21:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000006]: fb_cancel_operation(,db_handle=&00000002,option=3) return OK.
22:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#000004]: isc_dsql_fetch(...,stmt_handle=&00000004,...) return ERROR [335544794]
operation was cancelled
23:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000007]: isc_dsql_free_statement(...,stmt_handle=&00000004,1)
24:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000007]: isc_dsql_free_statement(...,stmt_handle=&00000004,1) return OK.
25:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000008]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...)
26:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000008]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
27:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#000009]: isc_dsql_fetch(...,stmt_handle=&00000004,...)
28:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#000009]: isc_dsql_fetch(...,stmt_handle=&00000004,...) return ERROR [335544569]
Dynamic SQL Error
SQL error code = -502
Attempt to reopen an open cursor
29:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000010]: isc_dsql_free_statement(...,stmt_handle=&00000004,1)
30:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000010]: isc_dsql_free_statement(...,stmt_handle=&00000004,1) return OK.
31:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000011]: isc_dsql_free_statement(...,stmt_handle=&00000004,2)
32:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000011]: isc_dsql_free_statement(...,stmt_handle=&00000000,2) return OK.
-------------
In line 23-24 I close my open cursor
In line 25-26 I re-execute statement
Why in line 28 (operation #000009) I obtain the error "Attempt to reopen an open cursor" ?
---------- [Test stored procedure]
CREATE PROCEDURE SP_PAUSE_FETCH(N INTEGER, PAUSE INTEGER)
RETURNS (ID INTEGER,DUMMY VARCHAR(32000))
AS
DECLARE VARIABLE P INTEGER;
DECLARE VARIABLE S INTEGER;
BEGIN
ID=0;
DUMMY='';
P=0;
WHILE(P<32000)DO
BEGIN
DUMMY=DUMMY||'A';
P=P+1;
END
S=0;
WHILE(S=0)DO
BEGIN
P=0;
WHILE(P<PAUSE) DO P=P+1;
IF(ID<N)THEN
BEGIN
ID=ID+1;
SUSPEND;
END
ELSE
BEGIN
S=1;
END
END
END
---------- [/Test stored procedure]
The text was updated successfully, but these errors were encountered:
When application executes FETCH, fbclient (lazy_send mode) can send three packets: (1) op_close_stmt (for previous cursor), (2) op_execute_stmt (open new cursor), (3) op_fetch (work with new cursor)
cancel of operation (in separated thread) can interrupt (1) op_close_stmt. But server in any case continues the execution of (2) and (3).
I think fbclient.dll loses the error for (1) and returns the error for (2)
Submitted by: @ibprovider
Server Version :2.5.3.26543 [Windows, SuperClassic, 64bit]
Client Version :2.5.3.26543 [Windows, 32bit]
Database ODS :11.2
Database Dialect:3
Connection through "localhost".
Work from 32bit application.
-----------------------------------------------
Common scenario:
1. thread1: execute statement "select ID,DUMMY from SP_PAUSE_FETCH(1000,10000000)"
2. thread2: fetch one row
3. thread1: cancel fetch (and wait the finish of cancelation)
4. thread1: close cursor
5. thread1: execute statment again
6. thread2: fetch one row -> ERROR "Attempt to reopen an open cursor"
-----------------------------------------------
Sequence of ISC API calls:
11:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000001]: isc_dsql_allocate_statement(...,db_handle=&00000002,stmt_handle=&00000000)
12:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000001]: isc_dsql_allocate_statement(...,db_handle=&00000002,stmt_handle=&00000004) return OK.
13:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000002]: isc_dsql_prepare(...,tr_handle=&00000003,stmt_handle=&00000004,...)
[stmt_text len:50]
select ID,DUMMY from SP_PAUSE_FETCH(1000,10000000)
[/stmt_text]
14:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000002]: isc_dsql_prepare(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
15:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000003]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...)
16:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000003]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
17:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#000004]: isc_dsql_fetch(...,stmt_handle=&00000004,...)
18:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000005]: fb_cancel_operation(,db_handle=&00000002,option=3)
19:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000005]: fb_cancel_operation(,db_handle=&00000002,option=3) return OK.
20:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000006]: fb_cancel_operation(,db_handle=&00000002,option=3)
21:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000006]: fb_cancel_operation(,db_handle=&00000002,option=3) return OK.
22:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#000004]: isc_dsql_fetch(...,stmt_handle=&00000004,...) return ERROR [335544794]
operation was cancelled
23:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000007]: isc_dsql_free_statement(...,stmt_handle=&00000004,1)
24:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000007]: isc_dsql_free_statement(...,stmt_handle=&00000004,1) return OK.
25:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000008]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...)
26:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000008]: isc_dsql_execute2(...,tr_handle=&00000003,stmt_handle=&00000004,...) return OK.
27:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#000009]: isc_dsql_fetch(...,stmt_handle=&00000004,...)
28:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#000009]: isc_dsql_fetch(...,stmt_handle=&00000004,...) return ERROR [335544569]
Dynamic SQL Error
SQL error code = -502
Attempt to reopen an open cursor
29:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000010]: isc_dsql_free_statement(...,stmt_handle=&00000004,1)
30:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000010]: isc_dsql_free_statement(...,stmt_handle=&00000004,1) return OK.
31:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#000011]: isc_dsql_free_statement(...,stmt_handle=&00000004,2)
32:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#000011]: isc_dsql_free_statement(...,stmt_handle=&00000000,2) return OK.
-------------
In line 23-24 I close my open cursor
In line 25-26 I re-execute statement
Why in line 28 (operation #000009) I obtain the error "Attempt to reopen an open cursor" ?
---------- [Test stored procedure]
CREATE PROCEDURE SP_PAUSE_FETCH(N INTEGER, PAUSE INTEGER)
RETURNS (ID INTEGER,DUMMY VARCHAR(32000))
AS
DECLARE VARIABLE P INTEGER;
DECLARE VARIABLE S INTEGER;
BEGIN
ID=0;
DUMMY='';
P=0;
WHILE(P<32000)DO
BEGIN
DUMMY=DUMMY||'A';
P=P+1;
END
S=0;
WHILE(S=0)DO
BEGIN
P=0;
WHILE(P<PAUSE) DO P=P+1;
IF(ID<N)THEN
BEGIN
ID=ID+1;
SUSPEND;
END
ELSE
BEGIN
S=1;
END
END
END
---------- [/Test stored procedure]
The text was updated successfully, but these errors were encountered: