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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Moe1
Contributor II
Contributor II

Iterate and tjava

Hi,

I need to read the records from a mysql table and for each row I need to execute 2 separate Java functions. This is what I did:

Tmysql -> tflowtoiterate ->(iterate) tjava1 -> (iterate) tjava2

 

The problem is that it executed all the rows in tjava1 but in tjava2 it executed some of the rows and not all of them. I tried putting them in the same tjava also did not work.. Any help would be appreciated. 

Labels (3)
7 Replies
iamabhishek
Creator III
Creator III

Do you receive any error messages?
What happens when you interchange your tJava1 & tJava2 so that iterate1->tJava2 and iterate2->tJava1 - what I am trying to understand here is will the code in tJava2 now work.
Moe1
Contributor II
Contributor II
Author

Thanks mate, no errors received, the job executes till the end successfully. Here is a small description on my job:
(Tmysql) I read rows from Mysql Table X and (tflowtoiterate) for each row, (tjava1) insert the row in  AS400/DB2 keyedDataQueue that inserts them in a table(Keyedqueue usually sends the key of each row to a dataqueue2 meaning it was inserted successfully), (tjava2) for each inserted row Delete the response from the response queue2 as it is no longer needed.

What happens in my case all the rows are being inserted successfully and for each row a response is created in dataqueue2 but when deleting the response, it is deleting some of them and not all of them (for each row).
e.g.: 40800 records inserted
30000 are deleted, sometimes 4000 only are deleted instead of 40800.

aashish_21nov
Creator
Creator

use tjavarow instead of tjava

Moe1
Contributor II
Contributor II
Author

I can not connect tflowtoiterate to tjavarow.
iamabhishek
Creator III
Creator III

How about you put some delay before the tJava2 which takes care of the deletion. Assuming the total db operation is asynchronous (not occurring at the same time) so its not able to find all the inserted row.
Moe1
Contributor II
Contributor II
Author

I used java sleep method before but then stopped the process as it is taking too much time if I choose 1 second, then used it to delay for 20, 50, 100 ms but the results were random sometimes it deleted 20000 and other times it deleted 25000..
Anonymous
Not applicable

Delete the tFlowToIterate and connect the tMysql directly to the tJavaRow.