Iterate and tjava

Six Stars Moe
Six Stars

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. 

Nine Stars

Re: Iterate and tjava

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.
Six Stars Moe
Six Stars

Re: Iterate and tjava

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.

Seven Stars

Re: Iterate and tjava

use tjavarow instead of tjava

Regards
Aashish
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars Moe
Six Stars

Re: Iterate and tjava

I can not connect tflowtoiterate to tjavarow.
Nine Stars

Re: Iterate and tjava

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.
Six Stars Moe
Six Stars

Re: Iterate and tjava

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..
Six Stars

Re: Iterate and tjava

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