August 30, 2013

Error: An Unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected... In AX



Error: 
When trying to create a new record(s) in any table system shows following error
eg. At the time of creating new Sales Order and this error may appear.
Possible Reason(s):
TTS level '1' usually leaves your Ax session in an unusable state that you can't close properly.

Check all code for form or class from where this error comes and count the ttsbegin and ttscommit there must be same like if u write 2 ttsbegin u must have to write 2 ttscommit.

Solution:
To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT.
static void TheAxaptaResetTTS(Args _args)
{
    while (appl.ttsLevel() > 0)
    {
        info(strfmt("Level %1 aborted",appl.ttsLevel()));
        ttsAbort;
    }
}

Other Info:
ttsBegin: marks the beginning of a transaction. This ensures data integrity, and guarantees that all updates performed until the transaction ends (by ttsCommit or ttsAbort) are consistent (all or none).

ttsCommit: marks the successful end of a transaction. This ends and commits a transaction. MorphX guarantees that a committed transaction will be performed according to intentions.

-Harry

3 comments:

  1. your blog is very helpful for me thanks a lot.by Rama.

    ReplyDelete
    Replies
    1. Thanks for your words, its all your support that make this blog more and more helpful for all of us.

      Delete
  2. DIY small business SEO packages blog for business owners & marketing / web design firms. Get tips, tools, templates & examples to increase your Internet visibility.

    ReplyDelete

Thanks