Commit in Codeunit 90

vsalotvsalot Member Posts: 47
Hi All,

Can I comment the last Commit function written in Codeunit 90.?

I am not using Analysis by Dimension.

Comments

  • EugeneEugene Member Posts: 309
    you can always remove COMMITs but i dont understand why would you ever want to do that ? It would degrade performance and increase lock timeouts
  • vsalotvsalot Member Posts: 47
    Because of that last commit funcation written over there, it is taking lot of time to post the PO. we are working on 380GB database... So for commiting the PO Transactions it is taking 4-5seconds.. That is the reason.. But i am not sure, about removing that commit function.
  • EugeneEugene Member Posts: 309
    if you remove the COMMIT from there then the COMMIT will happen later on and will take even more time.

    If one makes lot of data modifications in one transaction it will take some time to commit it, to shorten the time one should try to split the transaction in more smaller transactions (add more intermediate COMMITS) but often one simply cant do that because of the logic of the task. COMMITs are there to ensure data integrity as dictated by the task logic for example to transfer money from account A to account B one would:
    1) deduct the amount from A
    2) add the amount to B

    there can be no COMMIT between 1) and 2) because by the logic of the task either both operations go together or neither goes.
  • EugeneEugene Member Posts: 309
    I am not using Analysis by Dimension.
    Good for you :) because it can be a very lengthy operation. Luckily PO posting and calculating and filling in analysis views can go in separate transactions so the COMMIT is possible (and is there where you found it) between the two tasks and helps to improve performance
  • kinekine Member Posts: 12,562
    There are some cases when you need to skip the commits, but each time it is much better to add condition and function, through which you can set flag to skip it. Than in your process set the flag and it will skip the commit. It is better to keep the commit inside common proces, skip it in your specific case...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.