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.
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.
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
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...
Comments
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.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!