Year end processing

ryanchryanch Member Posts: 34
One of our companies hangs each time we try to run the year-end batch. The other companies (within the same database) succeeded. Please help.

Comments

  • girish.joshigirish.joshi Member Posts: 407
    That's pretty vague, we'll need so more information first.

    At a minimum please provide:

    1. Version of Navision
    2. Size of the database -- cache properties
    3. Modifications done?
    4. Access to a developers license?
    5. How does it hang? What does Task Manager say about usage?

    Can anyone think of anything else?
  • andrejsmandrejsm Member Posts: 122
    Hi,
    You should make debugger active. (Tools -> Debbuger -> Active) and than Navision will stop on the error place. Then try to understand where is the problem.
    Andrejs Muraskins
  • ara3nara3n Member Posts: 9,257
    andrejm, The ryanch says that it hangs. So he won't see any error.

    I guess he could follow your advice and turn on both options of debugger active and stop on trigger and hit F5 and see if he can find an infintely loop or the last place before it hangs.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Alex_ChowAlex_Chow Member Posts: 5,063
    ara3n wrote:
    andrejm, The ryanch says that it hangs. So he won't see any error.

    I guess he could follow your advice and turn on both options of debugger active and stop on trigger and hit F5 and see if he can find an infintely loop or the last place before it hangs.

    If Navision goes into a infinite loop, it would pop out a memory error.

    It may be just a long process? Ryanch, have you try to let it "hang" for longer period of time?
  • krikikriki Member, Moderator Posts: 9,118
    deadlizard wrote:
    If Navision goes into a infinite loop, it would pop out a memory error.
    [-X Only if it goes into an endless recursion.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Alex_ChowAlex_Chow Member Posts: 5,063
    kriki wrote:
    deadlizard wrote:
    If Navision goes into a infinite loop, it would pop out a memory error.
    [-X Only if it goes into an endless recursion.

    Isn't that what I said? :?:
  • girish.joshigirish.joshi Member Posts: 407
    No dead lizard, its not the same.

    An endless recursion is when you have two functions calling each other. This causes a memory error because each functions local variables/parameters have to allocate memory on the call stack, eventually causing the problem.

    An infinite loop is a loop that never terminates for example:
    while TRUE do begin
    
    end ;
    

    There isn't any mem allocation in that example, so there isn't ever a problem
  • girish.joshigirish.joshi Member Posts: 407
    ryanch -- do you still have the issue?
  • Alex_ChowAlex_Chow Member Posts: 5,063
    No dead lizard, its not the same.

    An endless recursion is when you have two functions calling each other. This causes a memory error because each functions local variables/parameters have to allocate memory on the call stack, eventually causing the problem.

    An infinite loop is a loop that never terminates for example:
    while TRUE do begin
    
    end ;
    

    Hmm.. but if in the repeat or while do loop, do you do some processing, wouldn't you get a memory error? :-k
  • girish.joshigirish.joshi Member Posts: 407
    Probably not. Just processing doesn't cause a memory error, memory has to be allocated.

    When I think about it, there are some diabolical ways you could make it happen, but you would have to be delibrately trying to cause the memory error.

    I can't think of anything standard that would cause it, even in the while true structure.
  • krikikriki Member, Moderator Posts: 9,118
    When I think about it, there are some diabolical ways you could make it happen, but you would have to be delibrately trying to cause the memory error.
    :twisted: "tmpGLEntry" is a temptable:
    WHILE TRUE DO BEGIN
      tmpGLEntry."Entry No." +=1;
      tmpGLEntry.INSERT(FALSE);
    END;
    
    This is an endless loop that will give some memory error.

    endless recursion 1:
    FUNCTION XYZ
    BEGIN
      FUNCTION XYZ();
      ...
      ....
    END;
    
    And now you just have to call xyz...


    endless recursion 2:
    FUNCTION XYZ
    BEGIN
      FUNCTION ABC();
      ...
      ....
    END;
    
    FUNCTION ABC
    BEGIN
      FUNCTION XYZ();
      ...
      ....
    END;
    
    And now you just have to call xyz or abc...
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • girish.joshigirish.joshi Member Posts: 407
    Yes, that's true the endless loop will give a memory error -- you have to watch out for overflows.

    But again, you can avoid doing things like that in your endless loops, and therefore avoid the memory error.

    You CANT avoid a memory error with a circular reference in functions. This is because there is a small memory overhead with every function call... even without parameters, local variables, etc.
  • ryanchryanch Member Posts: 34
    The problem was that we were checking multiple dimensions to close with and this would result in too many closing entries per G/L account hence the time spent per account. Actually the system was working in the background. The longest time we left it to run was overnight and this didnt make sense to us. Anyway thanx guys for your brilliant ideas.
Sign In or Register to comment.