General X++ Development
When should I use a transaction in X++?
When should I use a transaction in X++?
1 answer
Write an answerUse a transaction when multiple database changes must succeed or fail together.
For example, if you update a header and several related lines and a partial update would leave the data inconsistent, those changes probably belong in the same transaction.
ttsBegin;
// Related database changes.
ttsCommit;Keep transactions as short as you reasonably can. Holding a transaction open while doing slow calculations or user interaction is asking for locking problems.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer