Five Stars

trunJob 'Use an independent Process' is checked - pass data between mainjob

I have a main job that calls a subjob.
I need the subjob to be called with the 'Use independent process to run subjob' property checked.

I see where tBufferOut is not available with this setting checked.

Other than persisting data out to a file; and then reading back from the file; what is a way to move data in memory?

Ive tried playing with setting context variables and global map variables; but am not getting the changes persisted from the subjob back in the main job.


I'm not finding alot of documentation on the setting 'Use independent process to run subjob' and passing data.

Can someone share options or best practices to do this?

  • Data Integration

Re: trunJob 'Use an independent Process' is checked - pass data between mainjob

When trunJob 'Use an independent Process' is checked, the Talend Parent job launch the child job as an independent Java process.  Java security does not allow another process to access its memory or variable.  The memory space of that process is locked and limited to that process only.  The only way to pass back values is through files, or database.  


You can initialise the Java process, i.e. the child job with parameters (hence, that's why Talend can still pass context variables to it).  However, such a Java process can only either write the results somewhere, i.e. file or database, or just return a single value (i.e. the exit code of the application).

Hence, there is not much options here to get the results back through context variables or other in memory variable in this situation.


Reading a file or a record entry in a db is pretty fast though.  But you should not use files if many processes may be accessing the same files at the same time, else you may put some deadlock on the file.