Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Scope of variables

  1. #1
    Join Date
    Jul 2007
    Posts
    247

    Default Scope of variables

    Hello everybody,

    could one explain (again) the difference concerning the scope of variables one could use in kettle?

    By looking at the documentation and other tips, I would expect the following behavior:
    • Valid in the JVM: the variable is available in all jobs and transformations after the variable is set by a transformation.
    • Valid in the parent job: the variable is available in the job which set the variable (by a transformation) and the parent job.
    • Valid in the grant-parent job: same as parent job but also in the grant-parent job.
    • Valid in the root job: available the current job which set the variable and all jobs above it, no matter how many.
    What is the recommendation if one what like to run jobs parallel and variables may be changed by a single job - are variables thread safe?

    I also heard, that it might be problematic to use "valid in the JVM" in some cases, why is that and when problems may occur?

    Maybe anybody could give me some details about this topic and feel free to correct me if got anything wrong

    Thx in advance,
    Ben

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Valid in the JVM: the variable is available in all jobs and transformations after the variable is set by a transformation.
    Valid in the parent job: the variable is available in the job which set the variable (by a transformation) and the parent job.
    Valid in the grant-parent job: same as parent job but also in the grant-parent job.
    Valid in the root job: available the current job which set the variable and all jobs above it, no matter how
    Seems ok. Valid in the JVM uses System.setProperty (http://kettle.pentaho.org/svn/Kettle...tVariable.java).

    I normally would use "valid in the root job".

    Regards,
    Sven

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.