Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Could you please help me with the following issue ?
I have a simple job in which:
1. Cache initial data in tHashOutput
2. Do some stuff in a Loop - use cached data from point 1 (tHashOutput) as a lookup for tMap. Save results to tHashOutput_2 in order to reuse the new values in tMap ( tHashInput as a lookup) in consecutive iterations.
The reason I use tJava (just a dummy task) with OnComponentOk is so that Lookup in tMap was reloaded on each iteration.
tHashOutput_2 has "Link with a tHashOutput" set to tHashOutput_1.
If tHashInput_1 has unchecked box "Clear cache after reading" then the job succeeds execpt that the tHashInput is not cleared, so there are more rows then are supposed to be
If tHashInput_1 has checked box "Clear cache after reading" then the job fails with the following error in the first iteration:
Exception in component tHashOutput_2 (test3_Copy)
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)
at org.talend.designer.components.hashfile.common.MapHashFile.getAdvancedMemoryHashFile(MapHashFile.java:51)
Does anybody know how to fix it ? I read somewhere that playing with AdvancedMemoryHashFile is an option but I have no idea how to implement this.
Thank you in advance. I would appreciate some insights. I need to cache values in memory instead of going to the for example database layer.
Below I enclose pictures:
Hello,
Here is a related topic about:https://community.talend.com/t5/Design-and-Development/reusing-a-tHashOutput-after-a-clear-cache-aft... and let us know if it helps.
Best regards
Sabrina
Hi,
In the tHashInput_1, ensure the Clear cache after reading is NOT ticked.
Remember that should clear the cache after the loop, to ensure it doesn't hold on to the memory.
tHashInput (with clear cache) -> tJavaRow (that does nothing).
Thank you for the answer.
But the requirement is that I need to clear the tHashInput within each reload - if I uncheck "Clear cache after reading" then the rows in tHashInput will be appended (in first loop 2 rows, in second 3 rows and so on).
I attach this job.