最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

通过双向写入在D365 Finance Operation中进行了哪些更改(技术)/ What gets changed (Technical) in D365 Finance Operation with dual-write

网络文摘 William 53浏览 0评论
Being a developer I have to explore how a new feature or a framework has been developed and how can this be extended when needed. While working on dual-write implementation I came across many technical difficulties as the framework was not mature enough at that time since the dual-write is only generally available in end of March 2020 and I have been working on dual-write since mid-year 2019. I must say MS has done tremendous amount of work to make the integration with Microsoft Dynamics 365 Finance Operations apps and Common Data Services via Dual-write Bunch of AOT objects have been added at D365 FO side - screen shot taken from 10.0.13 these can grow with future releases if needed.
Application class has also been modified for dual-write, below method gets called when the database transaction tries to get committed, between ttsbegin and ttscommit.

public void ttsNotifyPreCommit()

    {

        if (!isInTtsNotifyPreCommit)

        {

            try

            {

                isInTtsNotifyPreCommit = true;

                if(sysTransactionScope)

                {

                    sysTransactionScope.onTtsCommitting();

                }

                   

                super();

                   

                if(this.canRaiseEvent())

                {

                    this.onTtsNotifyPreCommit();

                }

 

                // Checks that all suspension of recId allocation invoked by calling appl.SysRecIdSequence().suspendRecIds() have been removed.

                if(sysRecIdSequence)

                {

                    if (!this.sysRecIdSequence().areAllRecIdSuspensionsRemoved())

                    {

                        throw error("@SYS344764");

                    }

                    sysRecidSequence = null;

               }

 

               if (this.ttsLevel() == 1)

               {

                   DualWriteChangeProcessorBase::processTransactionPrecommit();

               }

            }

            finally

            {

                isInTtsNotifyPreCommit = false;

            }

        }

    }

Dual-write triggers only at ttsLevel 1, to understand this concept I did a small test.
From the trace log I can see that before ttscommit it goes to Application::ttsNotifyPreCommit and from there is makes a call to DualWriteChangeProcessorBase and in my scenario it goes to DualWriteSyncOutbound class.
If you dig deeper in this class, this creates the complete JSON message and sync this to CE. In my next post, I will show what tables, entities, classes are involved and how you can see what JSON message is going out from FO to CE. Stay tune.
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址