Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Microsoft.Dynamics.GP.eConnect.eConnectMethods.InitializeResources() - TransactionStartedEventHandler

Posted on by 60

Curious, why wouldn't the TransactionStartedEventHandler instanced in InitializeResources() be removed during operation or disposal of eConnectMethods?  I've tried just about everything I could think of...out of ideas...

 

 

*This post is locked for comments

  • pmarvin Profile Picture
    pmarvin 60 on at
    Re: Microsoft.Dynamics.GP.eConnect.eConnectMethods.InitializeResources() - TransactionStartedEventHandler

    Thanks Dave!

  • Verified answer
    Dave Dusek Profile Picture
    Dave Dusek on at
    Re: Microsoft.Dynamics.GP.eConnect.eConnectMethods.InitializeResources() - TransactionStartedEventHandler

    You are correct, this is a bug and we had found it previously.  The bug is addressed in the June HF 2011 release of econnect.  If you download the latest version, you should not have this issue.  

  • pmarvin Profile Picture
    pmarvin 60 on at
    Re: Microsoft.Dynamics.GP.eConnect.eConnectMethods.InitializeResources() - TransactionStartedEventHandler

    Unless someone says otherwise I'm calling this a bug in the Microsoft.Dynamics.GP.eConnect.dll.  Just need to figure out where to report it so it can be validated and handled accordingly.

     

    Assembly:           Microsoft.Dynamics.GP.eConnect.dll

    Namespace:       Microsoft.Dynamics.GP.eConnect

     

    eConnectMethods.InitializeResources() - the cause:

     

            private void IntializeResources()

            {

                this.RequireProxyService = Configuration.RequireProxyService;

                TransactionManager.DistributedTransactionStarted += new TransactionStartedEventHandler(this.DistributedTransactionStarted);

            }

     

    eConnectMethods.Dispose() – the root cause:

     

            public void Dispose()

            {

                SqlConnection.ClearAllPools();

                if ((ServiceProxy.ServiceProxyMethods != null) && (ServiceProxy.ServiceProxyMethods.State == CommunicationState.Opened))

                {

                    ServiceProxy instance = ServiceProxy.GetInstance(true);

                    if (instance != null)

                    {

                        instance.Dispose();

                    }

                }

                ActivityTracing.Dispose();

            }

     

    eConnectMethods.Dispose() – the fix:

     

            public void Dispose()

            {

                SqlConnection.ClearAllPools();

                if ((ServiceProxy.ServiceProxyMethods != null) && (ServiceProxy.ServiceProxyMethods.State == CommunicationState.Opened))

                {

                    ServiceProxy instance = ServiceProxy.GetInstance(true);

                    if (instance != null)

                    {

                        instance.Dispose();

                    }

                }

                TransactionManager.DistributedTransactionStarted -= this.DistributedTransactionStarted;

                ActivityTracing.Dispose();

            }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans