Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
RBarkerEV
Contributor
Contributor

Cursor already open or allocated error

We are currently running a Qlik replicate server that takes data from an iSeries database, processes it, and propagates it into an Azure database. Its been running fine without issues for some time.

This morning we ran into the error below with one of our Qlik tasks. This is happening with only 1 of the 4 tasks and continues to error out and remain in 'recovering' status as it continued to retry. Each time it retries it has a new Cursor ID that its complaining about, the one noted below is just from one of the attempted recovery attempts.

The below solutions have been tried without success:

1. Fully restarted the replicate server and services on the host/server machine.

2. Restarted all the IBM ODBC/JDBC jobs.

3. Ensured all reliant Journals and receivers were present on the IBM side.

4. Fully stopped and resumed the effected Qlik task.

5. Attempted a Full reload of the target task.

 

Any help with resolving this or any clues to what could be causing it would be greatly appreciated.

 

Error Details:

===============================================================

00003400: 2026-01-22T14:04:28 [SORTER ]I: Transaction consistency reached (sorter_transaction.c:326)
00008500: 2026-01-22T14:04:28 [TASK_MANAGER ]I: Starting replication now (replicationtask.c:3386)
00004112: 2026-01-22T14:04:33 [SOURCE_CAPTURE ]E: Failed (retcode -1) to execute statement: 'SELECT journal_code,journal_entry_type,sequence_number,commit_cycle,entry_timestamp,object,cast(null_value_indicators as VARBINARY(8000)) null_value_indicators,count_or_rrn,receiver_library,receiver_name,"CURRENT_USER",job_name,program_name, minimized_entry_data,cast(entry_data as VARBINARY(32740)) entry_data FROM TABLE(QSYS2.Display_Journal('$JRNLIB','RSD', OBJECT_OBJTYPE=>'*FILE', STARTING_TIMESTAMP=>'2026-01-22 14:58:39', JOURNAL_CODES=>'CDFRJ', JOURNAL_ENTRY_TYPES=>'PT,PX,UB,UP,DL,DR,BR,UR,CG,DF,CT,SC,CM,CR,RB,FN,PR', STARTING_RECEIVER_LIBRARY=>'*CURLIB', STARTING_RECEIVER_NAME=>'*CURCHAIN')) AS J WHERE (journal_entry_type in('SC','CM','CT','RB','PR') OR (substr(object,1,20) in ('T1  RSD ','T2 RSD ')))' [1022502] (ar_odbc_stmt.c:2822)
 
00004112: 2026-01-22T14:04:33 [SOURCE_CAPTURE ]E: RetCode: SQL_ERROR SqlState: 07005 NativeError: -502 Message: [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0502 - Cursor SQL_CURF1A474A0 already open or allocated. [1022502] (ar_odbc_stmt.c:2828)
 
00004112: 2026-01-22T14:04:33 [SOURCE_CAPTURE ]E: Error executing display_journal statement [1022511] (db2i_endpoint_capture.c:1634)
 
00008500: 2026-01-22T14:04:33 [TASK_MANAGER ]I: Task error notification received from subtask 0, thread 0, status 1022511 (replicationtask.c:3520)
00008500: 2026-01-22T14:04:33 [TASK_MANAGER ]W: Task 'PROD - RSD Tables' encountered a recoverable error (repository.c:6049)
00003400: 2026-01-22T14:04:33 [SORTER ]I: Final saved task state. Stream position timestamp:2026-01-22 21:04:28, Source id 8, next Target id 1, confirmed Target id 5, last source timestamp 0 (sorter.c:781)
 
00004112: 2026-01-22T14:04:33 [SOURCE_CAPTURE ]E: Error executing source loop [1022511] (streamcomponent.c:1942)
00004112: 2026-01-22T14:04:33 [TASK_MANAGER ]E: Stream component failed at subtask 0, component st_0_prd - RSD [1022511] (subtask.c:1433)
00004112: 2026-01-22T14:04:33 [SOURCE_CAPTURE ]E: Stream component 'st_0_prd - RSD' terminated [1022511] (subtask.c:1602)
 
00008500: 2026-01-22T14:04:34 [TASK_MANAGER ]I: Subtask #0 ended (replicationtask_util.c:591)
00008500: 2026-01-22T14:04:42 [SERVER ]I: Stop server request received internally (server.c:2410)
00008500: 2026-01-22T14:04:42 [TASK_MANAGER ]I: Task management thread terminated (replicationtask.c:4446)
00005720: 2026-01-22T14:04:44 [SERVER ]I: Client session (ID 1265182077) closed (dispatcher.c:195)
00005720: 2026-01-22T14:04:44 [UTILITIES ]I: The last state is saved to file 'E:\Attunity\Replicate\data\tasks\PROD - RSD Tables/StateManager/ars_saved_state_000001.sts' at Thu, 22 Jan 2026 21:04:33 GMT (1769115873906615) (statemanager.c:642)
00002200: 2026-01-22T14:04:44 [SERVER ]I: The process stopped (server.c:2537)
===============================================================
Labels (3)
1 Reply
DesmondWOO
Support
Support

Hi @RBarkerEV ,

Fully restarting Qlik Replicate should normally drop the ODBC connection and release all cursors.

To narrow this down, please try running the same SELECT query (QSYS2.Display_Journal) directly to see if the error reproduces outside of Replicate. It may also help to review the IBM job log for the relevant host job to check for any open cursors or related messages.

In addition, please confirm you are using the ODBC driver version we recommend in the user guide.

If the issue continues after these checks, please open a support ticket with us so we can investigate further.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!