Closed DavidFeldhoff closed 9 months ago
The CommitBehavior function was designed for the explicit commit, so this is by-design.
If we were to error out on implicit commits, the Codeunit.Run functionality would stop being useful. If the goal is to prevent Codeunit.Run, a LockTable/insert/modify on a table is enough to prevent any usage of Codeunit.Run, as Codeunit.Run requires that no changes are done on the transaction before calling Codeunit.Run.
I will log a bug to document that CommitBehavior only applies to explicit commits.
Please include the following with each issue:
1. Describe the bug With
[CommitBehavior(CommitBehavior::Error)]
or[CommitBehavior(CommitBehavior::Ignore)]
we should be able to avoid commits. But unfortunately implicit commits are still executed and therefore you can't trust it right now.2. To Reproduce Steps to reproduce the behavior:
3. Expected behavior Implicit commits can't be done as well. Otherwise you can't trust the CommitBehavior.
4. Actual behavior Implicit Commits, e.g. when working with the return value of Codeunit.Run, are still performed which is quite scary.
5. Versions:
Final Checklist
Please remember to do the following:
[x] Search the issue repository to ensure you are reporting a new issue
[x] Reproduce the issue after disabling all extensions except the AL Language extension
[x] Simplify your code around the issue to better isolate the problem