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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tJavaFlex output issue

Hi Everyone,

I'm having problem with the component tJavaFlex. I'm using it to create a row for each day between two date as you can see in the printscreen bellow.

0683p000009MFgX.png

It's working well, except when I want to insert the result in my DB, because I want to drop and create the table before the new insert. I did put this Action on table parameter, on my tMSSqlOutput, but because of the tJavaFlex loop, it drop and create a table each time a new loop is finish, ans I only get the last result in my DB.

Does anyone know how change the output flow of tJKavaFlex in only one flow ?


Do not hesitate to tell me if my explanation isn't clear enough,

Thank's in advance,

Julien 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

OK. It is the tFlowToIterate that is causing the issue.

For every row in the flow that hits the tFlowToIterate, it iterates the rest of the subjob per row. For every iteration, the tMSSqlOutput is restarted which is causing your issue. This is actually quite useful functionality in some situations, but not in this one. What you can do to get round this is to output your data from the tJavaFlex to a tHashOutput and use a tHashInput in a new subjob to read the data in and pass it to the DB. 

An example of how to do this is here: https://help.talend.com/pages/viewpage.action?pageId=8123271#technical-thashinput-scenario_speed

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Can you show us your job structure please? My immediate thought is that if you are connecting using a flow, this shouldn't happen. If you show us your job structure, it will be easier to see what might be happening.
Anonymous
Not applicable
Author

Hi Rhall,

0683p000009MFdy.png

Here is my job structrure,

Thank's for your help,

Julien
Anonymous
Not applicable
Author

OK. It is the tFlowToIterate that is causing the issue.

For every row in the flow that hits the tFlowToIterate, it iterates the rest of the subjob per row. For every iteration, the tMSSqlOutput is restarted which is causing your issue. This is actually quite useful functionality in some situations, but not in this one. What you can do to get round this is to output your data from the tJavaFlex to a tHashOutput and use a tHashInput in a new subjob to read the data in and pass it to the DB. 

An example of how to do this is here: https://help.talend.com/pages/viewpage.action?pageId=8123271#technical-thashinput-scenario_speed
Anonymous
Not applicable
Author

Thank's a lot Rhall, this solution is great !!

Could you please explain me, for my general knowledge, why it's so faster than updating the table each time a loop is finish ?
Update takes more than 300s and tHash solution takes less than 15s.

Julien
Anonymous
Not applicable
Author

I suspect you are seeing a difference in performance because previously you were dropping and creating a table for every row from your D_SEJOUR_MVT query. Now you are creating your dataset and inserting it after dropping and creating your table once.
Anonymous
Not applicable
Author

That makes sense.

Thank's again for your help !!

Have a good day,

Julien