Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Infinate loop when you have self referencing sub mappings?

  1. #1
    Join Date
    Apr 2007
    Posts
    2,009

    Default Infinate loop when you have self referencing sub mappings?

    Hi,

    I have 2 generic sub mappings.

    One is a "logger", the other is an "alerter".

    If i have the main transform, call the logger, which then calls the alerter because something fails in the logger, then i get into an infinate loop where it keeps "Dispatching started for transformation" ...

    This is because, the alerter also calls the logger to log what it's doing!

    So; User error, but is there a way to work around it?

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    So yes, this is an interesting problem.
    You would want to break out of the loop in case you're executing the same mapping that's already present in the hierarchy.

    However, up until recently (3.2.0-M2) the hierarchy itself was missing. This was fixed as part of a "Set variables in sub-transformation" bug fix.

    So I guess we could detect the situation by going up the chain.
    The question then becomes: do you allow recursive sub-transformations or not? If not, you have to exit with an error rendering your solution invalid anyway.

    In conclusion, not convinced you could do something about it, you could try to not call the alerter in case something goes wrong in the logger. Or at least not the same one as you used elsewhere. Break the chain somewhere and you'll be fine.

    Matt

  3. #3
    Join Date
    Apr 2007
    Posts
    2,009

    Default

    Ok thanks. I'll do just that. Just checking i wasnt missing anything obvious!

    For what it's worth i suspect banning recursion outright would be wrong - there's bound to be people out there that would like to do it or already do!

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    As you know, I'm not fond of banning in general. However, there are cases where it makes sense. In this case I guess it either works or crashes :-)

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.